Revert WebSocket Close issue#5940
Open
afifi-ins wants to merge 2 commits into
Open
Conversation
afifi-ins
added a commit
to afifi-ins/wcf
that referenced
this pull request
May 20, 2026
The integration test suite calls Close() unconditionally after PR dotnet#5940 (revert of WebSocket close workaround). On resource-constrained Helix Linux Open queues (2-4 vCPU), running tests at default parallelism can starve the SelfHosted(Core)WCF service and cause WebSocket close handshakes to time out, matching the failure pattern in issue dotnet#5819. Add a global default to Directory.Build.props that caps -maxthreads at min(ProcessorCount, 4) for any project with IsTestProject=true. This: - Resolves to '-maxthreads 2' on 2-vCPU Helix VMs (Linux Open queues) - Resolves to '-maxthreads 4' on 16-core dev boxes (preserves throughput) - Is consumed by the Helix xunit.console runner via _XunitOptions - Composes cleanly with existing per-project overrides: * Client.ChannelLayer: '-maxthreads 4 -maxthreads 16' (project wins, last value) * Client.ClientBase / Security.TransportSecurity: '-maxthreads 4 -parallel none' (parallel none disables threading regardless of maxthreads) - Can be overridden per-project by setting WcfHelixMaxThreads before the global default applies. Verified on WSL Ubuntu-24.04 with the SelfHostedCoreWCFService running and dotnet test pinned to 2 CPUs via 'taskset -c 0,1'. All 63 PR-affected WebSocket test cases (WebSocket_Http_Duplex_Buffered, WebSocket_Http/Https_ RequestReply_*) pass in 23 s with the cap applied. The pre-existing WebSocket_Http_Duplex_Streamed failures reproduce identically on main (both with and without the cap), confirming they are unrelated to PR dotnet#5940. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The integration test suite calls Close() unconditionally after PR dotnet#5940 (revert of WebSocket close workaround). On resource-constrained Helix Linux Open queues (2-4 vCPU), running tests at default parallelism can starve the SelfHosted(Core)WCF service and cause WebSocket close handshakes to time out, matching the failure pattern in issue dotnet#5819. Add a global default to Directory.Build.props that caps -maxthreads at min(ProcessorCount, 4) for any project with IsTestProject=true. This: - Resolves to '-maxthreads 2' on 2-vCPU Helix VMs (Linux Open queues) - Resolves to '-maxthreads 4' on 16-core dev boxes (preserves throughput) - Is consumed by the Helix xunit.console runner via _XunitOptions - Composes cleanly with existing per-project overrides: * Client.ChannelLayer: '-maxthreads 4 -maxthreads 16' (project wins, last value) * Client.ClientBase / Security.TransportSecurity: '-maxthreads 4 -parallel none' (parallel none disables threading regardless of maxthreads) - Can be overridden per-project by setting WcfHelixMaxThreads before the global default applies. Verified on WSL Ubuntu-24.04 with the SelfHostedCoreWCFService running and dotnet test pinned to 2 CPUs via 'taskset -c 0,1'. All 63 PR-affected WebSocket test cases (WebSocket_Http_Duplex_Buffered, WebSocket_Http/Https_ RequestReply_*) pass in 23 s with the cap applied. The pre-existing WebSocket_Http_Duplex_Streamed failures reproduce identically on main (both with and without the cap), confirming they are unrelated to PR dotnet#5940. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b76d916 to
d29320c
Compare
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.
Issue: #5818