test: Master key reload test fails on slow CI runners - #10708
Conversation
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. Tip
Note Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect. Caution Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe master-key TTL test replaces a short timed expiration with a 1,000-second TTL. It checks the cached expiration timestamp and verifies that the key reloads after the cache is explicitly expired. ChangesMaster-key TTL test
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The test now verifies TTL units and key reload after expiration; no actionable merge risk is evident from the reviewed change. 🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #10708 +/- ##
=======================================
Coverage 93.88% 93.88%
=======================================
Files 193 193
Lines 17061 17061
Branches 257 257
=======================================
Hits 16017 16017
Misses 1022 1022
Partials 22 22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
🎉 This change has been released in version 9.10.2-alpha.5 |
Pull Request
Issue
The test
should reload masterKey if ttl is set and expiredfails intermittently on CI withExpected spy unknown to have been called 2 times. It was called 4 times.It sets a master key TTL of 1 ms, but each request looks up the master key twice, so the key can expire within a request and be loaded more often than the test expects.Closes #10707, part of #10681.
Approach
masterKeyTtlto 1000 seconds and expires the cached key explicitly between the two requests, instead of waiting for a 1 ms TTL to elapse.masterKeyTtlseconds after it was loaded, which the previous test covered only implicitly by waiting for the expiry. The expected expiry is bounded by the time before the server starts and the time after the first request, so the check does not depend on request timing.masterKeyfunction returns a new key on every call (masterKey1,masterKey2, ...) instead of a list of two keys, so an unexpected call only fails the call count, instead of also resulting in anundefinedkey.Verified locally with MongoDB:
Tasks
Summary by CodeRabbit