Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ namespace Microsoft.Testing.Extensions.UnitTests;
[TestClass]
public sealed class CrashDumpTests
{
// AppDomain.CurrentDomain.GetData/SetData("ProcessKilledByHangDump") is a process-wide data slot
// (see CrashDumpProcessLifetimeHandler.OnTestHostProcessExitedAsync and
// HangDumpProcessLifetimeHandler.DumpTaking). Only the single test method below reads or writes it,
// so a method-level lock on that one test is enough to serialize it against itself without forcing
// the whole class to run sequentially.
private const string ProcessKilledByHangDumpAppDomainDataResource = "Microsoft.Testing.Extensions.CrashDump.ProcessKilledByHangDumpAppDomainData";

[TestMethod]
[DataRow("Mini")]
[DataRow("Heap")]
Expand Down Expand Up @@ -498,7 +505,7 @@ await handler.OnTestHostProcessExitedAsync(
}

[TestMethod]
[DoNotParallelize]
[ResourceLock(ProcessKilledByHangDumpAppDomainDataResource)]
Comment thread
Evangelink marked this conversation as resolved.
Resolved
public async Task OnTestHostProcessExitedAsync_ProcessKilledByHangDump_DeletesSequenceFileAndDoesNotPublishArtifacts()
{
string sequenceFile = Path.GetTempFileName();
Expand Down