1
0
Эх сурвалжийг харах

Hardening an Ix test where cancellation can bubble up.

Bart De Smet 10 жил өмнө
parent
commit
29dffab00a

+ 8 - 1
Ix.NET/Source/Tests/AsyncTests.Creation.cs

@@ -384,7 +384,14 @@ namespace Tests
             var t = e.MoveNext(cts.Token);
             cts.Cancel();
 
-            t.Wait();
+            try
+            {
+                t.Wait();
+            }
+            catch (AggregateException ex)
+            {
+                ex.Flatten().Handle(inner => inner is TaskCanceledException);
+            }
 
             Assert.IsTrue(disposed);
         }