Repository navigation
Synchronize WebSocket keep-alive timeout test with heartbeat completion - #135940
Merged
Merged
Conversation
Observe the ping frame and timeout-driven peer EOF instead of assuming timer callbacks ran within a fixed delay. Preserve the configured timeout and exact abort/error assertions under a bounded overall wait. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 843414a8-b1be-462a-ad95-df887006e36b
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
MihaZupan
approved these changes
Oct 16, 2026
This was referenced Oct 16, 2026
Closed
Member
Author
|
/ba-g Mutex test failures are unrelated |
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.
WebSocket_NoPongResponseWithinTimeout_Abortedassumes that a fixed 2.2-second delay is enough for both the first ping and its timeout heartbeat to run. Under delayed ThreadPool scheduling, the assertion can observeOpenbefore the ping deadline expires or before the overdue heartbeat is delivered.Read and validate the first ping, then await peer EOF from timeout-driven stream disposal before asserting
Aborted. Both waits use the existing bounded overall cancellation token. The 100 ms ping interval, 1-second pong timeout, and exact timeout exception assertions remain unchanged; no product code is changed.Validation
Q:\build.cmd clr+libs -rc release: passed, with three existing NU1902 warnings for the MsQuic dependency. Uses Release CoreCLR and Debug libraries.Q:\src\libraries\System.Net.WebSockets,Q:\.dotnet\dotnet.exe build /t:Test .\tests\System.Net.WebSockets.Tests.csproj /p:Outerloop=true: passed, 618 tests, zero failures or skips.Expected: Aborted, Actual: Openfor both theory cases. Restoring it passed both cases under 1.8-second and 2.6-second starvation. Instrumented controls showed correct timeout-driven state publication; disabling subsequent heartbeats produced bounded cancellation failures rather than false success.These reproductions establish a test synchronization defect, not the exact scheduling history of the CI failure. The separate canceled-receive-loop transitions tracked in #133374 are not addressed here.
Note
This pull request description and code change were generated with GitHub Copilot.