Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit db6af39

Browse files
committed
Merge pull request #2884 from stephentoub/fixwaitallanytasktest
Fix failing TaskWaitAllAny* tests
2 parents 5846440 + b50520e commit db6af39

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/System.Threading.Tasks/tests/Task/TaskWaitAllAnyTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ private void CleanUpTasks()
294294
if (taskInfo.Task.Status == TaskStatus.Running)
295295
{
296296
taskInfo.CancellationTokenSource.Cancel();
297-
taskInfo.Task.Wait();
297+
try { taskInfo.Task.GetAwaiter().GetResult(); }
298+
catch (OperationCanceledException) { }
298299
}
299300
}
300301
}

0 commit comments

Comments
 (0)