Auto-flush stdout in an attempt to get NUnit's output in the logs

This commit is contained in:
E M 2026-04-30 15:53:14 +10:00
parent d30706d2c5
commit cbef74f6cb
No known key found for this signature in database

View File

@ -32,6 +32,12 @@ namespace DistTestCore
public void Setup()
{
// Console.Out is block-buffered when stdout is non-interactive (e.g. in a container).
// Replace it with an auto-flushing wrapper so the NUnit runner's own "Passed/Failed"
// progress lines are written to pod stdout immediately after each test completes,
// rather than batching until process exit.
Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true });
try
{
Trace.Listeners.Add(new ConsoleTraceListener());