From c6f4f6848b0ef1721e47b07f7d441023a109c587 Mon Sep 17 00:00:00 2001 From: Nikolay Karadzhov Date: Thu, 9 Jul 2026 09:56:57 +0300 Subject: [PATCH] fix(client): stabilize flaky LATENCY LATEST test 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) --- packages/client/lib/commands/LATENCY_LATEST.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/lib/commands/LATENCY_LATEST.spec.ts b/packages/client/lib/commands/LATENCY_LATEST.spec.ts index 2cd2d9a5e06..865c0431e89 100644 --- a/packages/client/lib/commands/LATENCY_LATEST.spec.ts +++ b/packages/client/lib/commands/LATENCY_LATEST.spec.ts @@ -14,7 +14,7 @@ describe('LATENCY LATEST', () => { testUtils.testWithClient('client.latencyLatest', async client => { const [,, reply] = await Promise.all([ client.configSet('latency-monitor-threshold', '100'), - client.sendCommand(['DEBUG', 'SLEEP', '1']), + client.sendCommand(['DEBUG', 'SLEEP', '0.5']), client.latencyLatest() ]); assert.ok(Array.isArray(reply));