Explorar o código

Hardening an Ix test where cancellation can bubble up.

Bart De Smet %!s(int64=10) %!d(string=hai) anos
pai
achega
29dffab00a
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      Ix.NET/Source/Tests/AsyncTests.Creation.cs

+ 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);
         }