Skip to content

Fix flaky output truncation in CLI integration tests - #10384

Merged
joeloff merged 1 commit into
dotnet:release/10.0.4xxfrom
joeloff:threadstarvation
Jul 23, 2026
Merged

Fix flaky output truncation in CLI integration tests#10384
joeloff merged 1 commit into
dotnet:release/10.0.4xxfrom
joeloff:threadstarvation

Conversation

@joeloff

@joeloff joeloff commented Jul 23, 2026

Copy link
Copy Markdown
Member

StreamForwarder read the child process's redirected output on a thread-pool thread (Task.Run) one character at a time. Under CI load the thread pool can be starved, delaying the reader so the OS pipe fills and the child blocks on Console.Write. The child's asynchronous console logger (AddSimpleConsole) then drops queued messages when its bounded flush-on-dispose (~1.5s) times out, truncating captured output and producing cut-off Verify received.txt files.

Read on a dedicated long-running thread and in 4096-char chunks so the pipe is drained promptly and the child is never blocked long enough to lose output.

StreamForwarder read the child process's redirected output on a
thread-pool thread (Task.Run) one character at a time. Under CI load the
thread pool can be starved, delaying the reader so the OS pipe fills and
the child blocks on Console.Write. The child's asynchronous console
logger (AddSimpleConsole) then drops queued messages when its bounded
flush-on-dispose (~1.5s) times out, truncating captured output and
producing cut-off Verify received.txt files.

Read on a dedicated long-running thread and in 4096-char chunks so the
pipe is drained promptly and the child is never blocked long enough to
lose output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a88c2700-ee2f-4a55-9272-f19d9b8537d7
@joeloff
joeloff requested a review from a team as a code owner July 23, 2026 21:12
@baronfel

Copy link
Copy Markdown
Member

wow, what a find

@joeloff
joeloff enabled auto-merge (squash) July 23, 2026 21:26
@joeloff
joeloff merged commit 8cdb39a into dotnet:release/10.0.4xx Jul 23, 2026
9 checks passed
@joeloff

joeloff commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

/backport to release/10.0.3xx

@github-actions

Copy link
Copy Markdown

Started backporting to release/10.0.3xx (link to workflow run)

joeloff added a commit that referenced this pull request Jul 24, 2026
…ts (#10387)

Backport of #10384 to release/10.0.3xx

/cc @joeloff

Co-authored-by: Jacques Eloff <joeloff@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a88c2700-ee2f-4a55-9272-f19d9b8537d7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants