Merged
Conversation
…imeout delays The 'evicts oldest entries when cache exceeds max size' test was flaky in CI because it used 5ms delays between cache entries to create different timestamps. This is too tight for CI environments where: - Date.now() resolution can be 10-15ms on some systems - System load causes timing variations exceeding 5ms Increased delays from 5ms to 20ms to ensure reliable timestamp separation across different CI environments. Co-authored-by: Amitabh Aggarwal <amitabh94@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
AxelGes
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
The test "evicts oldest entries when cache exceeds max size" in
RampsController.test.tswas flaky. It used 5mssetTimeoutdelays to create distinct timestamps for cache entries, which was too short for reliable execution in CI environments due toDate.now()resolution limitations and execution timing variations under load. This led to non-deterministic cache eviction order.The
setTimeoutdelays within this specific test have been increased from 5ms to 20ms. This provides a more robust time separation between cache entries, ensuring distinct timestamps and consistent eviction behavior, thereby resolving the flakiness.References
RampsController.test.ts.Checklist
Slack Thread
Note
Low Risk
Test-only timing tweak; no production code paths are changed, with minimal risk beyond slightly longer test runtime.
Overview
Makes the
RampsControllercache-eviction test deterministic in CI by increasing the inter-request delay used to create distinct timestamps.In
RampsController.test.ts, thecache evictiontest now waits20ms(was5ms) betweenexecuteRequestcalls so the “oldest entry” eviction order is stable.Written by Cursor Bugbot for commit 063cbe7. This will update automatically on new commits. Configure here.