diff --git a/Tests/DistTestCore/DistTest.cs b/Tests/DistTestCore/DistTest.cs index d33e0c7f..34773cf4 100644 --- a/Tests/DistTestCore/DistTest.cs +++ b/Tests/DistTestCore/DistTest.cs @@ -100,9 +100,9 @@ namespace DistTestCore using var raw = new StreamWriter(Console.OpenStandardOutput(), leaveOpen: true) { AutoFlush = true }; raw.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(entry)); } - catch + catch (Exception ex) { - // Best-effort; don't fail the teardown if status emission fails. + Console.Error.WriteLine($"[test-result-emit] Failed: {ex}"); } } diff --git a/Tests/DistTestCore/Global.cs b/Tests/DistTestCore/Global.cs index c35f53d1..ce6746c2 100644 --- a/Tests/DistTestCore/Global.cs +++ b/Tests/DistTestCore/Global.cs @@ -52,6 +52,10 @@ namespace DistTestCore { GlobalTestFailure.HasFailed = true; log.Error($"Global setup cleanup failed with: {ex}"); + // Write directly to raw stderr so this is visible even when NUnit + // captures Console.Out/Console.Error for the fixture setup context. + using var err = new StreamWriter(Console.OpenStandardError(), leaveOpen: true) { AutoFlush = true }; + err.WriteLine($"[global-setup-failure] {ex}"); throw; } }