Skip to content

Commit 130ec43

Browse files
authored
Improve crash/hang support in helix (#24489)
1 parent 723e32a commit 130ec43

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

eng/helix/content/RunTests/TestRunner.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public async Task<int> RunTestsAsync()
247247
{
248248
// Timeout test run 5 minutes before the Helix job would timeout
249249
var cts = new CancellationTokenSource(Options.Timeout.Subtract(TimeSpan.FromMinutes(5)));
250-
var commonTestArgs = $"vstest {Options.Target} --logger:xunit --logger:\"console;verbosity=normal\" --blame";
250+
var commonTestArgs = $"test {Options.Target} --logger:xunit --logger:\"console;verbosity=normal\" --blame \"CollectHangDump;TestTimeout=5m\"";
251251
if (Options.Quarantined)
252252
{
253253
Console.WriteLine("Running quarantined tests.");
@@ -331,6 +331,22 @@ public void UploadResults()
331331
{
332332
Console.WriteLine("No logs found in artifacts/log");
333333
}
334+
Console.WriteLine($"Copying TestResults/**/*.dmp to {HELIX_WORKITEM_UPLOAD_ROOT}/");
335+
if (Directory.Exists("TestResults"))
336+
{
337+
foreach (var file in Directory.EnumerateFiles("TestResults", "*.dmp", SearchOption.AllDirectories))
338+
{
339+
var fileName = Path.GetFileName(file);
340+
Console.WriteLine($"Copying: {file} to {Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, fileName)}");
341+
// Need to copy to HELIX_WORKITEM_UPLOAD_ROOT and HELIX_WORKITEM_UPLOAD_ROOT/../ in order for Azure Devops attachments to link properly and for Helix to store the logs
342+
File.Copy(file, Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, fileName));
343+
File.Copy(file, Path.Combine(HELIX_WORKITEM_UPLOAD_ROOT, "..", fileName));
344+
}
345+
}
346+
else
347+
{
348+
Console.WriteLine("No dmps found in TestResults");
349+
}
334350
}
335351
}
336352
}

0 commit comments

Comments
 (0)