Give the socket tests a thread pool that can answer them - #740
Merged
Conversation
AttachedViewerTests failed intermittently on CI with "No response for Inline", on a different platform and a different test each run, and never locally. ServerFixture drives the real ViewerClient, whose send is synchronous, so a test holds a pool thread for the whole exchange while the server needs threads of its own to accept the connection and answer it. Two per exchange, against the four or so a runner starts with. Enough of them at once and the answer waits on the pool adding roughly one thread a second, past the client's three second timeout. Confirmed rather than assumed. With DOTNET_ThreadPool_ForceMaxWorkerThreads=2 the whole suite fails that way four runs out of four, while the class on its own passes nine out of nine, which is the tell: it needs the rest of the suite competing for the pool. With the floor forced to one and the maximum left alone, the intermittent shape comes back exactly as CI shows it. A send that answers in 26ms unstarved took 516ms with the pool merely busy. Raising the floor removes the scarcity rather than the blocking. The blocking is real, but it belongs to the client the tray and an attached viewer use, and nothing outside a test host runs dozens of those at once. Five runs of the suite under the conditions that used to fail now pass.
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.
AttachedViewerTests failed intermittently on CI with "No response for Inline", on a different platform and a different test each run, and never locally.
ServerFixture drives the real ViewerClient, whose send is synchronous, so a test holds a pool thread for the whole exchange while the server needs threads of its own to accept the connection and answer it. Two per exchange, against the four or so a runner starts with. Enough of them at once and the answer waits on the pool adding roughly one thread a second, past the client's three second timeout.
Confirmed rather than assumed. With DOTNET_ThreadPool_ForceMaxWorkerThreads=2 the whole suite fails that way four runs out of four, while the class on its own passes nine out of nine, which is the tell: it needs the rest of the suite competing for the pool. With the floor forced to one and the maximum left alone, the intermittent shape comes back exactly as CI shows it. A send that answers in 26ms unstarved took 516ms with the pool merely busy.
Raising the floor removes the scarcity rather than the blocking. The blocking is real, but it belongs to the client the tray and an attached viewer use, and nothing outside a test host runs dozens of those at once. Five runs of the suite under the conditions that used to fail now pass.