From a2c526d17eeb0259008ffe339df6764e1dd13571 Mon Sep 17 00:00:00 2001 From: kiryazovi-redis Date: Wed, 3 Dec 2025 15:50:11 +0200 Subject: [PATCH 1/3] Add debug info to assertion messages for root cause analysis --- .../tests/test-scenario/timeout-during-notifications.e2e.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts b/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts index 848e17f4506..3c3456275c3 100644 --- a/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts +++ b/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts @@ -125,17 +125,17 @@ describe("Timeout Handling During Notifications", () => { notifications.forEach((notification) => { assert.ok( result[notification]?.error instanceof Error, - `${notification} notification error should be instanceof Error` + `${notification} notification error should be instanceof Error. Got: ${JSON.stringify(result[notification])}` ); assert.ok( result[notification]?.duration >= RELAXED_COMMAND_TIMEOUT && result[notification]?.duration < RELAXED_COMMAND_TIMEOUT * 1.2, - `${notification} notification should timeout within relaxed timeout` + `${notification} notification should timeout within relaxed timeout. Duration: ${result[notification]?.duration}, Expected: [${RELAXED_COMMAND_TIMEOUT}, ${RELAXED_COMMAND_TIMEOUT * 1.2})` ); assert.strictEqual( result[notification]?.error?.constructor?.name, "CommandTimeoutDuringMaintenanceError", - `${notification} notification error should be CommandTimeoutDuringMaintenanceError` + `${notification} notification error should be CommandTimeoutDuringMaintenanceError. Got: ${result[notification]?.error?.constructor?.name}` ); }); }); From 0173fa7af48de1ab640b67a331b032f66c344452 Mon Sep 17 00:00:00 2001 From: kiryazovi-redis Date: Wed, 3 Dec 2025 16:46:13 +0200 Subject: [PATCH 2/3] Fix flaky timeout assertion in maintenance notification test --- .../tests/test-scenario/timeout-during-notifications.e2e.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts b/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts index 3c3456275c3..e1b68f52e74 100644 --- a/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts +++ b/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts @@ -128,9 +128,9 @@ describe("Timeout Handling During Notifications", () => { `${notification} notification error should be instanceof Error. Got: ${JSON.stringify(result[notification])}` ); assert.ok( - result[notification]?.duration >= RELAXED_COMMAND_TIMEOUT && + result[notification]?.duration >= RELAXED_COMMAND_TIMEOUT * 0.8 && result[notification]?.duration < RELAXED_COMMAND_TIMEOUT * 1.2, - `${notification} notification should timeout within relaxed timeout. Duration: ${result[notification]?.duration}, Expected: [${RELAXED_COMMAND_TIMEOUT}, ${RELAXED_COMMAND_TIMEOUT * 1.2})` + `${notification} notification should timeout within relaxed timeout. Duration: ${result[notification]?.duration}, Expected: [${RELAXED_COMMAND_TIMEOUT * 0.8}, ${RELAXED_COMMAND_TIMEOUT * 1.2})` ); assert.strictEqual( result[notification]?.error?.constructor?.name, From e9296a24e2e7ed5f68f40791d08ad34c588d471c Mon Sep 17 00:00:00 2001 From: kiryazovi-redis Date: Wed, 3 Dec 2025 17:43:08 +0200 Subject: [PATCH 3/3] Apply same tolerance fix to NORMAL_COMMAND_TIMEOUT assertions --- .../test-scenario/timeout-during-notifications.e2e.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts b/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts index e1b68f52e74..29db5cc391d 100644 --- a/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts +++ b/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts @@ -164,9 +164,9 @@ describe("Timeout Handling During Notifications", () => { "Command Timeout error should be instanceof Error" ); assert.ok( - durationMigrate >= NORMAL_COMMAND_TIMEOUT && + durationMigrate >= NORMAL_COMMAND_TIMEOUT * 0.8 && durationMigrate < NORMAL_COMMAND_TIMEOUT * 1.2, - `Normal command should timeout within normal timeout ms` + `Normal command should timeout within normal timeout ms. Duration: ${durationMigrate}, Expected: [${NORMAL_COMMAND_TIMEOUT * 0.8}, ${NORMAL_COMMAND_TIMEOUT * 1.2})` ); assert.strictEqual( errorMigrate?.constructor?.name, @@ -199,9 +199,9 @@ describe("Timeout Handling During Notifications", () => { "Command Timeout error should be instanceof Error" ); assert.ok( - durationBind >= NORMAL_COMMAND_TIMEOUT && + durationBind >= NORMAL_COMMAND_TIMEOUT * 0.8 && durationBind < NORMAL_COMMAND_TIMEOUT * 1.2, - `Normal command should timeout within normal timeout ms` + `Normal command should timeout within normal timeout ms. Duration: ${durationBind}, Expected: [${NORMAL_COMMAND_TIMEOUT * 0.8}, ${NORMAL_COMMAND_TIMEOUT * 1.2})` ); assert.strictEqual( errorBind?.constructor?.name,