-
Notifications
You must be signed in to change notification settings - Fork 182
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 request count tests for FS operations with metadata caching enabled #567
Add request count tests for FS operations with metadata caching enabled #567
Conversation
Signed-off-by: Daniel Carl Jones <[email protected]>
…ith caching enabled Signed-off-by: Daniel Carl Jones <[email protected]>
Signed-off-by: Daniel Carl Jones <[email protected]>
Signed-off-by: Daniel Carl Jones <[email protected]>
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.
neat!
assert_eq!(head_counter.count(), 1); | ||
assert_eq!(list_counter.count(), 1); |
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.
to the previous comment, this surprised me until I understood what prefer_s3
meant
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.
probably also worth an uncached version of this test that confirms we do the requests again on open
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.
agree! I'm wondering whether it is enough to find a way to run existing tests with and without caching: if they pass, then it must have gone to S3.
that being said, maybe it's nice to codify the number of requests we expect.
still thinking here.
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.
We don't want to go too overboard with hard-coding the exact request counts for all these scenarios in the uncached case, but one uncached test would be helpful.
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.
Added a case here for lookup only test_lookup_then_open_no_cache
Signed-off-by: Daniel Carl Jones <[email protected]>
Signed-off-by: Daniel Carl Jones <[email protected]>
Description of change
When adding metadata caching, we not only want to ensure that cached data is served but also verify we aren't still making S3 requests and the repeated S3 requests are truly eliminated.
This adds counter functionality to the mock client in
mountpoint-s3-client
, and adds a few tests covering the cached cases. We may also want to add more assertions to existing tests or test the cases with caching turned off.Relevant issues: #255
Does this change impact existing behavior?
No change, tests only.
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).