test(alarms): probe writes evidence log to PROBE_LOG file

This commit is contained in:
Joseph Doherty
2026-06-13 11:15:05 -04:00
parent 0e8d911fd8
commit 98e997b573
@@ -175,13 +175,22 @@ public sealed class AlarmSubtagLiveSmokeTests
done.Wait();
thread.Join();
List<string> lines = new List<string>();
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;