From f2948b268ef2b606cbd5d74fb0e25e5cacfb98b7 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 16 May 2019 13:05:19 -0700 Subject: [PATCH] [XHarness] Show when we have a watch HE0038 error. (#6060) To simplify the life of the monitorer, if we get a crash with a HE0038 we will propagate the result to the html and will provide a link to the issue so that it is easy to report it. --- tests/xharness/Jenkins.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/xharness/Jenkins.cs b/tests/xharness/Jenkins.cs index 8208d7726c..3a1a270492 100644 --- a/tests/xharness/Jenkins.cs +++ b/tests/xharness/Jenkins.cs @@ -1643,6 +1643,23 @@ namespace xharness } } + bool IsHE0038Error (Log log) { + if (log == null) + return false; + if (File.Exists (log.FullPath) && new FileInfo (log.FullPath).Length > 0) { + using (var reader = log.GetReader ()) { + while (!reader.EndOfStream) { + string line = reader.ReadLine ()?.Trim (); + if (line == null) + continue; + if (line.StartsWith ("error HE0038", StringComparison.Ordinal)) + return true; + } + } + } + return false; + } + string previous_test_runs; void GenerateReportImpl (Stream stream, StreamWriter markdown_summary = null) { @@ -2002,7 +2019,12 @@ namespace xharness writer.Write ($"
"); writer.Write ($"{defaultExpander}"); - writer.Write ($"{title} ({state}{buildOnly}) "); + // we have a very common error we want to make this easier for the person that is dealing with the results + if (test.ExecutionResult == TestExecutingResult.Crashed && IsHE0038Error (logs.First (l => l.Description == "Run log"))) { + writer.Write ($"{title} ({state} HE0038{buildOnly}) "); + } else { + writer.Write ($"{title} ({state}{buildOnly}) "); + } if (IsServerMode) { writer.Write ($" "); if (test.Waiting) {