test(codex): give the blocked-replacement handshake a workable deadline - #126
Open
AlexanderKugel wants to merge 1 commit into
Open
test(codex): give the blocked-replacement handshake a workable deadline#126AlexanderKugel wants to merge 1 commit into
AlexanderKugel wants to merge 1 commit into
Conversation
cancellation_while_replacement_startup_is_blocked_aborts_request_state waits for the replacement WebSocket handshake before asserting anything. That wait had a two-second deadline, and the handshake takes about 2.5 seconds, so the test failed on every run here. The assertion is about cancellation cleanup, not about latency, so the deadline only needs enough headroom to stop deciding the result. Five seconds passes 5 runs out of 5, each finishing in about 2.6 seconds.
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.
Fixes #124.
Problem
cancellation_while_replacement_startup_is_blocked_aborts_request_statewaits for the replacement WebSocket handshake before it asserts anything. That wait had a two-second deadline:The handshake takes about 2.5 seconds here, so the wait expired every time and the test failed before reaching its assertions:
Change
Raise that one deadline to five seconds.
The assertion under test is cancellation cleanup, not handshake latency, so the deadline only needs enough headroom to stop deciding the result.
Verification
cargo test --lib: 861 passed, 0 failed.cargo fmt --checkclean.Tested on Linux 6.18 (WSL2), rustc 1.97.1. The margin is now roughly double the observed handshake time, so a slower machine has room as well.