diff --git a/src/ZB.MOM.WW.MxGateway.Worker.Tests/Probes/AlarmSubtagLiveSmokeTests.cs b/src/ZB.MOM.WW.MxGateway.Worker.Tests/Probes/AlarmSubtagLiveSmokeTests.cs index 43a1bae..41ff65a 100644 --- a/src/ZB.MOM.WW.MxGateway.Worker.Tests/Probes/AlarmSubtagLiveSmokeTests.cs +++ b/src/ZB.MOM.WW.MxGateway.Worker.Tests/Probes/AlarmSubtagLiveSmokeTests.cs @@ -175,13 +175,22 @@ public sealed class AlarmSubtagLiveSmokeTests done.Wait(); thread.Join(); + List lines = new List(); output.WriteLine(string.Format("Captured {0} log line(s):", log.Count)); string? line; while (log.TryDequeue(out line)) { output.WriteLine(line); + lines.Add(line); } + // Also persist to a file so the evidence survives shell-logger quirks + // when run over SSH. Path overridable via PROBE_LOG. + string logPath = Environment.GetEnvironmentVariable("PROBE_LOG") + ?? System.IO.Path.Combine(System.IO.Path.GetTempPath(), "alarm-subtag-probe.log"); + try { System.IO.File.WriteAllLines(logPath, lines); } + catch (Exception writeEx) { output.WriteLine("probe-log write failed: " + writeEx.Message); } + if (threadException != null) { throw threadException;