Sfoglia il codice sorgente

Set sync context to null to get around hangs

Oren Novotny 10 anni fa
parent
commit
5ff94d8579

+ 3 - 0
Ix.NET/Source/Tests/System.Interactive.Tests.xproj

@@ -18,6 +18,9 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
     <ProduceOutputsOnBuild>True</ProduceOutputsOnBuild>
   </PropertyGroup>
+  <ItemGroup>
+    <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
+  </ItemGroup>
   <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
   <ProjectExtensions>
     <VisualStudio>

+ 7 - 2
Ix.NET/Source/Tests/Tests.Creation.cs

@@ -5,6 +5,7 @@ using System.Collections.Generic;
 using System.Linq;
 using Xunit;
 using System.Collections;
+using System.Threading;
 
 namespace Tests
 {
@@ -41,9 +42,11 @@ namespace Tests
         }
 
 #if HAS_AWAIT
-        [Fact(Skip = "inner async/await usage causes deadlock in xUnit test runner")]
+        [Fact]
         public void CreateYield()
         {
+            SynchronizationContext.SetSynchronizationContext(null);
+
             var xs = EnumerableEx.Create<int>(async yield => {
                 var i = 0;
                 while (i < 10)
@@ -62,9 +65,11 @@ namespace Tests
             Assert.Equal(j, 10);
         }
 
-        [Fact(Skip = "inner async/await usage causes deadlock in xUnit test runner")]
+        [Fact]
         public void CreateYieldBreak()
         {
+            SynchronizationContext.SetSynchronizationContext(null);
+
             var xs = EnumerableEx.Create<int>(async yield => {
                 var i = 0;
                 while (true)