-
Notifications
You must be signed in to change notification settings - Fork 458
feat(dentry cache): Add integration tests for dentry cache #3562
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
base: master
Are you sure you want to change the base?
Conversation
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.
Summary of Changes
Hello @aditimittal2003, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request focuses on enhancing the test coverage for the dentry cache feature by introducing a comprehensive suite of end-to-end integration tests. These tests are designed to validate the cache's behavior regarding file attribute caching, metadata freshness, and its ability to correctly invalidate entries when external modifications occur, thereby improving the reliability and stability of the dentry cache.
Highlights
- New Integration Test Suite: I've introduced a new end-to-end integration test package specifically for the dentry cache feature, which is enabled by the
--experimental-enable-dentry-cache
flag. This suite aims to validate the correctness of the dentry cache implementation under various scenarios. - Stat Cache Behavior Validation: A new test (
stat_test.go
) has been added to verify thatos.Stat
correctly returns cached file attributes and that these attributes are properly refreshed after the metadata cache TTL (Time-To-Live) expires. This ensures the cache behaves as expected regarding metadata freshness. - Notifier Invalidation Testing: New tests (
notifier_test.go
) have been implemented to ensure that when a cached file is modified externally on GCS, subsequentread
andwrite
operations initially fail, triggering a cache invalidation. This invalidation then allows the very next attempt to succeed, confirming the notifier mechanism works as intended for cache consistency. - Test Execution Updates: The existing test execution scripts (
improved_run_e2e_tests.sh
,run_e2e_tests.sh
,run_tests_mounted_directory.sh
) have been updated to include and run these newly added dentry cache integration tests, ensuring they are part of the regular test pipeline.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request adds valuable integration tests for the dentry cache feature, covering both stat cache behavior and notifier-based invalidation. The changes are well-structured and the test logic is sound.
I've identified a few issues that need attention. Most importantly, there are critical copy-paste errors in the test execution script that would prevent the new tests from running. Additionally, I found a recurring pattern of unchecked errors in the test files that could mask underlying bugs, and a minor potential for test flakiness due to a fixed-duration sleep.
I've provided specific suggestions to address these points. Once these are resolved, this will be a great addition to the test suite.
d938783
to
17fb918
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3562 +/- ##
==========================================
- Coverage 79.70% 0 -79.71%
==========================================
Files 142 0 -142
Lines 18971 0 -18971
==========================================
- Hits 15120 0 -15120
+ Misses 3340 0 -3340
+ Partials 511 0 -511
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
17fb918
to
5e8344a
Compare
Description
This change introduces a new e2e integration test package for the dentry cache feature, enabled by the
--experimental-enable-dentry-cache
flag.These tests validate the correctness of the dentry cache implementation under different scenarios:
os.Stat
returns cached file attributes and that these are correctly refreshed after the metadata cache TTL expires. This is covered instat_test.go
.read
andwrite
operations fail initially, triggering a cache invalidation that allows the next attempt to succeed. This is covered innotifier_test.go
.The test execution scripts have also been updated to run these new tests.
Link to the issue in case of a bug fix.
Testing details
Any backward incompatible change? If so, please explain.