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();
|
done.Wait();
|
||||||
thread.Join();
|
thread.Join();
|
||||||
|
|
||||||
|
List<string> lines = new List<string>();
|
||||||
output.WriteLine(string.Format("Captured {0} log line(s):", log.Count));
|
output.WriteLine(string.Format("Captured {0} log line(s):", log.Count));
|
||||||
string? line;
|
string? line;
|
||||||
while (log.TryDequeue(out line))
|
while (log.TryDequeue(out line))
|
||||||
{
|
{
|
||||||
output.WriteLine(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)
|
if (threadException != null)
|
||||||
{
|
{
|
||||||
throw threadException;
|
throw threadException;
|
||||||
|
|||||||
Reference in New Issue
Block a user