这是indexloc提供的服务,不要输入任何密码
Skip to content

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aditimittal2003
Copy link
Collaborator

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:

  • Stat Cache Behavior: A new test verifies that os.Stat returns cached file attributes and that these are correctly refreshed after the metadata cache TTL expires. This is covered in stat_test.go.
  • Notifier Invalidation: New tests ensure that when a cached file is modified externally on GCS, subsequent read and write operations fail initially, triggering a cache invalidation that allows the next attempt to succeed. This is covered in notifier_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

  1. Manual - NA
  2. Unit tests - NA
  3. Integration tests - Added

Any backward incompatible change? If so, please explain.

@aditimittal2003 aditimittal2003 requested review from Tulsishah and a team as code owners July 22, 2025 10:00
@github-actions github-actions bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Jul 22, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a 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 that os.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, subsequent read and write 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

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

@kislaykishore kislaykishore requested a review from a team July 22, 2025 10:00
Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

@aditimittal2003 aditimittal2003 added execute-perf-test Execute performance test in PR execute-integration-tests Run only integration tests labels Jul 23, 2025
Copy link

codecov bot commented Jul 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (4335552) to head (17fb918).
Report is 4 commits behind head on master.

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     
Flag Coverage Δ
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execute-integration-tests Run only integration tests execute-perf-test Execute performance test in PR remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants