-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a test for an invalid cache block #1139
Conversation
Signed-off-by: Vlad Volodkin <[email protected]>
Signed-off-by: Vlad Volodkin <[email protected]>
Signed-off-by: Vlad Volodkin <[email protected]>
Signed-off-by: Vlad Volodkin <[email protected]>
Signed-off-by: Vlad Volodkin <[email protected]>
Signed-off-by: Vlad Volodkin <[email protected]>
use test_case::test_case; | ||
|
||
#[cfg(all(feature = "s3_tests", feature = "s3express_tests"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not blocking: we should consider moving (some of) the use
into the functions that require them (to avoid all the cfg
).
let (mount_point, _session) = mount_bucket(client.clone(), cache.clone(), &bucket, &prefix); | ||
|
||
// Put an object to the mounted bucket | ||
let object_key = generate_unprefixed_key(&prefix, "key", 100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why pass the prefix then? can't you subtract the prefix's length from 100, if that's what you want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually can't we just use a fixed key here? And leave the other test where we generate the key intact?
.await | ||
.expect("put object must succeed"); | ||
|
||
// Expect a successfull read from the source bucket. We expect cache errors being recorded because of the corrupted block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny nit: successful
@@ -1,4 +1,4 @@ | |||
#[cfg(all(feature = "s3_tests", feature = "s3express_tests"))] | |||
#[cfg(feature = "s3_tests")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is redundant now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not blocking)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to keep it to make cargo test --features fuse_tests --no-run
buildable. The file only contains s3_tests
so it's preferable to having multiple snippets like this in the code:
#[cfg(feature = "s3_tests")]
use crate::common::fuse::s3_session::create_crt_client;
## Description of change Just test improvements. Addresses comments from the #1139. Relevant issues: N/A. ## Does this change impact existing behavior? No. ## Does this change need a changelog entry in any of the crates? No. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the [Developer Certificate of Origin (DCO)](https://developercertificate.org/). --------- Signed-off-by: Vlad Volodkin <[email protected]> Co-authored-by: Vlad Volodkin <[email protected]>
Description of change
Just adds a test that if a block in the shared cache is invalid, it is not served to the client application.
Relevant issues: N/A
Does this change impact existing behavior?
No.
Does this change need a changelog entry in any of the crates?
No.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).