Skip to content

Commit

Permalink
Compat test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
madelson committed Apr 11, 2019
1 parent 8b9306d commit 50efd76
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions SampleCommand/PlatformCompatibilityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,18 @@ public static void TestBadProcessFile()

public static void TestAttaching()
{
var processCommand = Command.Run("SampleCommand", new[] { "sleep", "10000" });
var processId = processCommand.ProcessId;
if (!Command.TryAttachToProcess(processId, out _))
var processCommand = Command.Run(SampleCommandPath, new[] { "sleep", "10000" });
try
{
throw new InvalidOperationException("Wasn't able to attach to the running process.");
var processId = processCommand.ProcessId;
if (!Command.TryAttachToProcess(processId, out _))
{
throw new InvalidOperationException("Wasn't able to attach to the running process.");
}
}
finally
{
processCommand.Kill();
}
}

Expand Down

0 comments on commit 50efd76

Please sign in to comment.