Skip to content
Merged
Changes from all commits
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
3 changes: 2 additions & 1 deletion Tests/Common/IsolatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ public void Cancellation()
var ended = false;
var canceled = false;
var result = false;
isolator.CancellationTokenSource.CancelAfter(TimeSpan.FromMilliseconds(100));
try
{
result = isolator.ExecuteWithTimeLimit(
TimeSpan.FromSeconds(5),
() => {
executed = true;
// cancel only once the code block is running so the task can't be canceled before it starts
isolator.CancellationTokenSource.CancelAfter(TimeSpan.FromMilliseconds(100));
Thread.Sleep(5000);
ended = true;
},
Expand Down
Loading