Skip to content

Give the socket tests a thread pool that can answer them - #740

Merged
SimonCropp merged 1 commit into
mainfrom
viewer-socket-flake
Aug 11, 2026
Merged

Give the socket tests a thread pool that can answer them#740
SimonCropp merged 1 commit into
mainfrom
viewer-socket-flake

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

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.

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.
@SimonCropp
SimonCropp merged commit f33ba9e into main Aug 11, 2026
8 checks passed
@SimonCropp
SimonCropp deleted the viewer-socket-flake branch August 11, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant