test(alarms): probe writes evidence log to PROBE_LOG file
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user