Fix flaky timeout assertion in maintenance notification test #3143
+8
−8
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.
Problem
The test
should relax command timeout on MOVING, MIGRATINGwas flaky in CI, failing with:Timeout Handling During Notifications should relax command timeout on MOVING, MIGRATING: AssertionError MOVING notification should timeout within relaxed timeout. Duration: 1999.5784149999963, Expected: [2000, 2400) - AssertionError [ERR_ASSERTION]: MOVING notification should timeout within relaxed timeout. Duration: 1999.5784149999963, Expected: [2000, 2400)
at /home/runner/work/cae-client-testing/cae-client-testing/client_src/packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts:2:3572
at Array.forEach ()
at Context. (packages/client/lib/tests/test-scenario/timeout-during-notifications.e2e.ts:2:3336)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Root Cause
The assertion checked that the measured duration was exactly
>= RELAXED_COMMAND_TIMEOUT(2000ms). In CI environments, timing precision can vary due to container overhead, CPU scheduling, and other factors, causing the measured duration to occasionally fall slightly below the expected threshold.Solution
1.0xto0.8xofRELAXED_COMMAND_TIMEOUT, allowing durations in the range [1600ms, 2400ms) instead of [2000ms, 2400ms)Changes
timeout-during-notifications.e2e.ts: Relaxed lower bound check and improved assertion messages