Skip to content

Commit

Permalink
Add log for elapsedSeconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Duplenskikh committed Nov 8, 2023
1 parent 31ee577 commit 7f3d450
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Test/L0/ProcessInvokerL0.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ public async Task TestCancel()
long elapsedSeconds = watch.ElapsedMilliseconds / 1000;

// if cancellation fails, then execution time is more than 15 seconds
long expectedSeconds = (SecondsToRun * 3) / 4;
long expectedSeconds = SecondsToRun * 3 / 4;

trace.Info($"Before assert elapsed ms: {watch.ElapsedMilliseconds}");

Assert.True(elapsedSeconds <= expectedSeconds, $"cancellation failed, because task took too long to run. {elapsedSeconds}");
Console.WriteLine($"Elapsed seconds for TestCancel test: {elapsedSeconds}");

Assert.True(elapsedSeconds <= 0, $"cancellation failed, because task took too long to run. {elapsedSeconds}");
}
}
}
Expand Down

0 comments on commit 7f3d450

Please sign in to comment.