Conditionally run CallSitesAreUniquePerServiceTypeAndSlot test based on threading...
authorElinor Fung <elfung@microsoft.com>
Tue, 18 May 2021 05:04:12 +0000 (22:04 -0700)
committerGitHub <noreply@github.com>
Tue, 18 May 2021 05:04:12 +0000 (22:04 -0700)
src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceLookup/CallSiteFactoryTest.cs

index 5a72853..e027508 100644 (file)
@@ -739,7 +739,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void CallSitesAreUniquePerServiceTypeAndSlot()
         {
             // Connected graph
@@ -748,7 +748,6 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup
             // Class5 -> Class2 -> Class3
             var types = new Type[] { typeof(Class1), typeof(Class2), typeof(Class3), typeof(Class4), typeof(Class5) };
 
-
             for (int i = 0; i < 100; i++)
             {
                 var factory = GetCallSiteFactory(types.Select(t => ServiceDescriptor.Transient(t, t)).ToArray());
@@ -776,7 +775,7 @@ namespace Microsoft.Extensions.DependencyInjection.ServiceLookup
             }
         }
 
-        [Fact]
+        [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
         public void CallSitesAreUniquePerServiceTypeAndSlotWithOpenGenericInGraph()
         {
             // Connected graph