fix(client): stabilize flaky LATENCY LATEST test#3326
Open
nkaradzhov wants to merge 1 commit into
Open
Conversation
The `client.latencyLatest` test blocked the server for a full second via `DEBUG SLEEP 1`, leaving little headroom under mocha's 2000ms default timeout once connection setup and flushAll overhead were added. On loaded CI runners the test intermittently timed out. Halve the sleep to `0.5` (500ms), which still comfortably exceeds the 100ms `latency-monitor-threshold` so a latency event is recorded, while roughly doubling the non-sleep budget under the timeout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
This pull request fixes a flaky
client.latencyLatesttest inpackages/client/lib/commands/LATENCY_LATEST.spec.ts.The bug
The test issued
DEBUG SLEEP 1, blocking the server for a full second. Combined with connection setup and theflushAllcalls the harness runs before/after each test, this left little headroom under mocha's 2000ms default timeout. On loaded CI runners it intermittently exceeded the timeout:The fix
Halve the sleep to
0.5(500ms). It still comfortably exceeds thelatency-monitor-thresholdof 100ms, so a latency event is still recorded and the assertions remain meaningful, while roughly doubling the non-sleep budget under the 2000ms timeout. This matches the pattern in sibling specs (LATENCY_RESET.spec.tsusesDEBUG SLEEP 0.1against a 1ms threshold).Locally the test now completes in ~550ms.
🤖 Generated with Claude Code
Note
Low Risk
Test-only timing tweak with no production or client API changes.
Overview
Reduces the Redis
DEBUG SLEEPduration in theclient.latencyLatestintegration test from 1s to 0.5s so the case stays under Mocha’s default 2000ms timeout on slow CI, where harness setup andflushAllleft little margin after a full-second block.The 100ms
latency-monitor-thresholdis unchanged, so 500ms sleep still triggers latency events and the existing shape assertions stay valid—aligned with shorter sleeps used in other LATENCY specs (e.g.LATENCY_RESET).Reviewed by Cursor Bugbot for commit c6f4f68. Bugbot is set up for automated code reviews on this repo. Configure here.