Skip to content
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

Merged
merged 6 commits into from
Nov 15, 2024

Conversation

vladem
Copy link
Contributor

@vladem vladem commented Nov 14, 2024

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).

@vladem vladem had a problem deploying to PR integration tests November 14, 2024 21:23 — with GitHub Actions Failure
@vladem vladem had a problem deploying to PR integration tests November 14, 2024 21:23 — with GitHub Actions Failure
@vladem vladem had a problem deploying to PR integration tests November 14, 2024 21:23 — with GitHub Actions Failure
@vladem vladem had a problem deploying to PR integration tests November 14, 2024 21:23 — with GitHub Actions Failure
@vladem vladem had a problem deploying to PR integration tests November 14, 2024 21:23 — with GitHub Actions Failure
@vladem vladem had a problem deploying to PR integration tests November 14, 2024 21:23 — with GitHub Actions Failure
@vladem vladem had a problem deploying to PR integration tests November 14, 2024 21:23 — with GitHub Actions Failure
@vladem vladem temporarily deployed to PR integration tests November 14, 2024 21:37 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 14, 2024 21:37 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 14, 2024 21:37 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 14, 2024 21:37 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 14, 2024 21:37 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 14, 2024 21:37 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 14, 2024 21:37 — with GitHub Actions Inactive
@vladem vladem requested review from passaro and muddyfish November 14, 2024 21:53
Signed-off-by: Vlad Volodkin <[email protected]>
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 12:17 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 12:17 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 12:17 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 12:17 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 12:17 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 12:17 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 12:17 — with GitHub Actions Inactive
@vladem vladem requested a review from passaro November 15, 2024 13:24
mountpoint-s3/tests/fuse_tests/cache_test.rs Outdated Show resolved Hide resolved
mountpoint-s3/tests/fuse_tests/cache_test.rs Outdated Show resolved Hide resolved
mountpoint-s3/tests/fuse_tests/cache_test.rs Outdated Show resolved Hide resolved
mountpoint-s3/tests/fuse_tests/cache_test.rs Outdated Show resolved Hide resolved
mountpoint-s3/tests/fuse_tests/cache_test.rs Outdated Show resolved Hide resolved
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 15:07 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 15:07 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 15:07 — with GitHub Actions Inactive
@vladem vladem requested a review from passaro November 15, 2024 16:32
Signed-off-by: Vlad Volodkin <[email protected]>
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 16:47 — with GitHub Actions Inactive
@vladem vladem had a problem deploying to PR integration tests November 15, 2024 16:47 — with GitHub Actions Failure
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 16:47 — with GitHub Actions Inactive
@vladem vladem had a problem deploying to PR integration tests November 15, 2024 16:47 — with GitHub Actions Failure
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 16:47 — with GitHub Actions Inactive
@vladem vladem had a problem deploying to PR integration tests November 15, 2024 16:47 — with GitHub Actions Failure
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 16:47 — with GitHub Actions Inactive
Signed-off-by: Vlad Volodkin <[email protected]>
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 16:55 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 16:55 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 16:55 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 16:55 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 16:55 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 16:55 — with GitHub Actions Inactive
@vladem vladem temporarily deployed to PR integration tests November 15, 2024 16:55 — with GitHub Actions Inactive
@vladem vladem enabled auto-merge November 15, 2024 17:10
@vladem vladem added this pull request to the merge queue Nov 15, 2024
Merged via the queue into awslabs:main with commit 3738860 Nov 15, 2024
23 checks passed
@vladem vladem deleted the express-cache-tests-corrupted branch November 15, 2024 18:01
use test_case::test_case;

#[cfg(all(feature = "s3_tests", feature = "s3express_tests"))]
Copy link
Contributor

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);
Copy link
Contributor

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?

Copy link
Contributor

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.
Copy link
Contributor

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")]
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(not blocking)

Copy link
Contributor Author

@vladem vladem Nov 19, 2024

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;

github-merge-queue bot pushed a commit that referenced this pull request Nov 20, 2024
## 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants