diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml
index fc8d757233cd45..ddbf00e89ce24f 100644
--- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml
+++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml
@@ -105,6 +105,32 @@ jobs:
scenarios:
- WasmTestOnNodeJS
+ # Library tests with full threading & blocking .Wait
+ - template: /eng/pipelines/common/templates/wasm-library-tests.yml
+ parameters:
+ platforms:
+ - browser_wasm
+ nameSuffix: _Threading_BlockingWait
+ extraBuildArgs: /p:WasmEnableThreads=true /p:_WasmAllowBlockingWait=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
+ isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
+ isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
+ alwaysRun: ${{ parameters.isWasmOnlyBuild }}
+ scenarios:
+ - WasmTestOnBrowser
+
+ # Library tests with full threading & running tests on thread pool
+ - template: /eng/pipelines/common/templates/wasm-library-tests.yml
+ parameters:
+ platforms:
+ - browser_wasm
+ nameSuffix: _Threading_BackgroundExec
+ extraBuildArgs: /p:WasmEnableThreads=true /p:_XUnitBackgroundExec=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
+ isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
+ isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }}
+ alwaysRun: ${{ parameters.isWasmOnlyBuild }}
+ scenarios:
+ - WasmTestOnBrowser
+
# Library tests - Windows
- template: /eng/pipelines/common/templates/wasm-library-tests.yml
parameters:
diff --git a/eng/testing/tests.browser.targets b/eng/testing/tests.browser.targets
index 06f07c898eabcb..448d1a9c5d6679 100644
--- a/eng/testing/tests.browser.targets
+++ b/eng/testing/tests.browser.targets
@@ -87,8 +87,10 @@
<_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(WasmMainAssemblyFileName)' != ''">--run $(WasmMainAssemblyFileName)
<_AppArgs Condition="'$(IsFunctionalTest)' == 'true'">--run $(AssemblyName).dll
- <_XUnitBackgroundExec Condition="'$(_XUnitBackgroundExec)' == '' and '$(WasmEnableThreads)' == 'true'">true
$(WasmTestAppArgs) -backgroundExec
+
+ $(WasmXHarnessMonoArgs) --allow-blocking-wait
+ $(WasmXHarnessMonoArgs) --setenv=IsWasmAllowBlockingWait=true
$(WasmXHarnessMonoArgs) --setenv=IsWasmBackgroundExec=true
<_AppArgs Condition="'$(WasmTestAppArgs)' != ''">$(_AppArgs) $(WasmTestAppArgs)
diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs
index 0ffd0d4ae82eda..444d43cf65cc27 100644
--- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs
+++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs
@@ -1229,7 +1229,7 @@ await server.AcceptConnectionAsync(async connection =>
});
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public async Task ReadAsStreamAsync_EmptyResponseBody_HandlerProducesWellBehavedResponseStream()
{
if (IsWinHttpHandler && UseVersion >= HttpVersion20.Value)
diff --git a/src/libraries/Common/tests/System/TimeProviderTests.cs b/src/libraries/Common/tests/System/TimeProviderTests.cs
index 7a0cb33eb74d78..809ff6da495840 100644
--- a/src/libraries/Common/tests/System/TimeProviderTests.cs
+++ b/src/libraries/Common/tests/System/TimeProviderTests.cs
@@ -214,7 +214,7 @@ private static void CancelAfter(TimeProvider provider, CancellationTokenSource c
}
#endif // NETFRAMEWORK
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[MemberData(nameof(TimersProvidersListData))]
public static void CancellationTokenSourceWithTimer(TimeProvider provider)
{
diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs
index 210e8b6fc99f7c..44f11d4fb4d972 100644
--- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs
+++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs
@@ -135,10 +135,12 @@ public static int SlowRuntimeTimeoutModifier
public static bool IsThreadingSupported => (!IsWasi && !IsBrowser) || IsWasmThreadingSupported;
public static bool IsWasmThreadingSupported => IsBrowser && IsEnvironmentVariableTrue("IsBrowserThreadingSupported");
public static bool IsNotWasmThreadingSupported => !IsWasmThreadingSupported;
- public static bool IsWasmBackgroundExec => IsBrowser && IsEnvironmentVariableTrue("IsWasmBackgroundExec");
+ public static bool IsWasmBackgroundExec => IsBrowser && IsWasmThreadingSupported && IsEnvironmentVariableTrue("IsWasmBackgroundExec");
public static bool IsThreadingSupportedNotBrowserBackgroundExec => IsWasmThreadingSupported && !IsWasmBackgroundExec;
+ public static bool IsWasmAllowBlockingWait => IsBrowser && IsWasmThreadingSupported && IsEnvironmentVariableTrue("IsWasmAllowBlockingWait");
public static bool IsWasmBackgroundExecOrSingleThread => IsWasmBackgroundExec || IsNotWasmThreadingSupported;
- public static bool IsThreadingSupportedOrBrowserBackgroundExec => IsWasmBackgroundExec || !IsBrowser;
+ public static bool IsThreadingSupportedAndBlockingWait => IsWasmBackgroundExec || IsWasmAllowBlockingWait || (!IsWasi && !IsBrowser);
+ public static bool IsThreadingSupportedAndNotBlockingWait => (!IsWasmBackgroundExec && !IsWasmAllowBlockingWait) && IsWasmThreadingSupported;
public static bool IsBinaryFormatterSupported => IsNotMobile && !IsNativeAot;
public static bool IsStartingProcessesSupported => !IsiOS && !IstvOS;
diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceLookup/CallSiteFactoryTest.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceLookup/CallSiteFactoryTest.cs
index 74f85296af9521..edb3f38709e935 100644
--- a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceLookup/CallSiteFactoryTest.cs
+++ b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceLookup/CallSiteFactoryTest.cs
@@ -792,7 +792,7 @@ public void CreateCallSite_EnumberableCachedAtLowestLevel(ServiceDescriptor[] de
Assert.Equal(typeof(IEnumerable), callSite.Cache.Key.ServiceIdentifier.ServiceType);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void CallSitesAreUniquePerServiceTypeAndSlot()
{
// Connected graph
@@ -828,7 +828,7 @@ public void CallSitesAreUniquePerServiceTypeAndSlot()
}
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void CallSitesAreUniquePerServiceTypeAndSlotWithOpenGenericInGraph()
{
// Connected graph
diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceProviderContainerTests.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceProviderContainerTests.cs
index f668cee41efc35..ff099ea249161b 100644
--- a/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceProviderContainerTests.cs
+++ b/src/libraries/Microsoft.Extensions.DependencyInjection/tests/DI.Tests/ServiceProviderContainerTests.cs
@@ -371,7 +371,7 @@ public void GetService_DisposeOnSameThread_Throws()
});
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void GetAsyncService_DisposeAsyncOnSameThread_ThrowsAndDoesNotHangAndDisposeAsyncGetsCalled()
{
// Arrange
@@ -398,7 +398,7 @@ public void GetAsyncService_DisposeAsyncOnSameThread_ThrowsAndDoesNotHangAndDisp
Assert.True(asyncDisposableResource.DisposeAsyncCalled);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void GetService_DisposeOnSameThread_ThrowsAndDoesNotHangAndDisposeGetsCalled()
{
// Arrange
diff --git a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs
index f123b65bb58bc3..b2e5b77cb1f0cc 100644
--- a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs
+++ b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs
@@ -37,7 +37,7 @@ public void BuildWebHostPattern_CanFindServiceProvider()
Assert.IsAssignableFrom(factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(BuildWebHostInvalidSignature.Program))]
public void BuildWebHostPattern__Invalid_CantFindWebHost()
{
@@ -46,7 +46,7 @@ public void BuildWebHostPattern__Invalid_CantFindWebHost()
Assert.Null(factory);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(BuildWebHostInvalidSignature.Program))]
public void BuildWebHostPattern__Invalid_CantFindServiceProvider()
{
@@ -55,7 +55,7 @@ public void BuildWebHostPattern__Invalid_CantFindServiceProvider()
Assert.NotNull(factory);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateWebHostBuilderPatternTestSite.Program))]
public void CreateWebHostBuilderPattern_CanFindWebHostBuilder()
{
@@ -65,7 +65,7 @@ public void CreateWebHostBuilderPattern_CanFindWebHostBuilder()
Assert.IsAssignableFrom(factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateWebHostBuilderPatternTestSite.Program))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(IWebHost))]
public void CreateWebHostBuilderPattern_CanFindServiceProvider()
@@ -76,7 +76,7 @@ public void CreateWebHostBuilderPattern_CanFindServiceProvider()
Assert.IsAssignableFrom(factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateWebHostBuilderInvalidSignature.Program))]
public void CreateWebHostBuilderPattern__Invalid_CantFindWebHostBuilder()
{
@@ -85,7 +85,7 @@ public void CreateWebHostBuilderPattern__Invalid_CantFindWebHostBuilder()
Assert.Null(factory);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateWebHostBuilderInvalidSignature.Program))]
public void CreateWebHostBuilderPattern__InvalidReturnType_CanFindServiceProvider()
{
@@ -95,7 +95,7 @@ public void CreateWebHostBuilderPattern__InvalidReturnType_CanFindServiceProvide
Assert.Null(factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateHostBuilderPatternTestSite.Program))]
public void CreateHostBuilderPattern_CanFindHostBuilder()
{
@@ -105,7 +105,7 @@ public void CreateHostBuilderPattern_CanFindHostBuilder()
Assert.IsAssignableFrom(factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateHostBuilderPatternTestSite.Program))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(Host))]
public void CreateHostBuilderPattern_CanFindServiceProvider()
@@ -116,7 +116,7 @@ public void CreateHostBuilderPattern_CanFindServiceProvider()
Assert.IsAssignableFrom(factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateHostBuilderInvalidSignature.Program))]
public void CreateHostBuilderPattern__Invalid_CantFindHostBuilder()
{
@@ -125,7 +125,7 @@ public void CreateHostBuilderPattern__Invalid_CantFindHostBuilder()
Assert.Null(factory);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateHostBuilderInvalidSignature.Program))]
public void CreateHostBuilderPattern__Invalid_CantFindServiceProvider()
{
@@ -135,7 +135,7 @@ public void CreateHostBuilderPattern__Invalid_CantFindServiceProvider()
Assert.Throws(() => factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))]
public void NoSpecialEntryPointPattern()
{
@@ -145,7 +145,7 @@ public void NoSpecialEntryPointPattern()
Assert.IsAssignableFrom(factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))]
public void NoSpecialEntryPointPatternHostBuilderConfigureHostBuilderCallbackIsCalled()
{
@@ -163,7 +163,7 @@ void ConfigureHostBuilder(object hostBuilder)
Assert.True(called);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))]
public void NoSpecialEntryPointPatternBuildsThenThrowsCallsEntryPointCompletedCallback()
{
@@ -183,7 +183,7 @@ void EntryPointCompleted(Exception? exception)
Assert.Null(entryPointException);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternBuildsThenThrows.Program))]
public void NoSpecialEntryPointPatternBuildsThenThrowsCallsEntryPointCompletedCallbackWithException()
{
@@ -203,7 +203,7 @@ void EntryPointCompleted(Exception? exception)
Assert.NotNull(entryPointException);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternThrows.Program))]
public void NoSpecialEntryPointPatternThrows()
{
@@ -213,7 +213,7 @@ public void NoSpecialEntryPointPatternThrows()
Assert.Throws(() => factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternExits.Program))]
public void NoSpecialEntryPointPatternExits()
{
@@ -223,7 +223,7 @@ public void NoSpecialEntryPointPatternExits()
Assert.Throws(() => factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternHangs.Program))]
public void NoSpecialEntryPointPatternHangs()
{
@@ -233,7 +233,7 @@ public void NoSpecialEntryPointPatternHangs()
Assert.Throws(() => factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternMainNoArgs.Program))]
public void NoSpecialEntryPointPatternMainNoArgs()
{
@@ -243,7 +243,7 @@ public void NoSpecialEntryPointPatternMainNoArgs()
Assert.IsAssignableFrom(factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "TopLevelStatements")]
public void TopLevelStatements()
{
@@ -254,7 +254,7 @@ public void TopLevelStatements()
Assert.IsAssignableFrom(factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "TopLevelStatementsTestsTimeout")]
public void TopLevelStatementsTestsTimeout()
{
@@ -265,7 +265,7 @@ public void TopLevelStatementsTestsTimeout()
Assert.Throws(() => factory(Array.Empty()));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "ApplicationNameSetFromArgument")]
public void ApplicationNameSetFromArgument()
{
@@ -277,7 +277,7 @@ public void ApplicationNameSetFromArgument()
Assert.Contains("ApplicationNameSetFromArgument", configuration["applicationName"]);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))]
public void NoSpecialEntryPointPatternCanRunInParallel()
{
diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs
index 81bb589fcfb31c..8057d3abeb34d1 100644
--- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs
+++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs
@@ -1203,7 +1203,7 @@ public async Task AddHttpClient_MessageHandler_Scope_TransientDependency()
}
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec), nameof(PlatformDetection.IsReflectionEmitSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait), nameof(PlatformDetection.IsReflectionEmitSupported))]
public void AddHttpClient_GetAwaiterAndResult_InSingleThreadedSynchronizationContext_ShouldNotHangs()
{
// Arrange
diff --git a/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionCancellationTests.cs b/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionCancellationTests.cs
index 14fa6d8d487467..b7caf5d96ab75a 100644
--- a/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionCancellationTests.cs
+++ b/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionCancellationTests.cs
@@ -10,7 +10,7 @@ namespace System.Collections.Concurrent.Tests
{
public class BlockingCollectionCancellationTests
{
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void InternalCancellation_CompleteAdding_Negative()
{
BlockingCollection coll1 = new BlockingCollection();
@@ -26,7 +26,7 @@ public static void InternalCancellation_CompleteAdding_Negative()
}
//This tests that Take/TryTake wake up correctly if CompleteAdding() is called while waiting
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void InternalCancellation_WakingUp()
{
for (int test = 0; test < 2; test++)
@@ -60,7 +60,7 @@ public static void InternalCancellation_WakingUp()
}
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void ExternalCancel_Negative()
{
BlockingCollection bc = new BlockingCollection(); //empty collection.
@@ -96,7 +96,7 @@ public static void ExternalCancel_Negative()
cs.Token);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void ExternalCancel_AddToAny()
{
for (int test = 0; test < 3; test++)
@@ -129,7 +129,7 @@ public static void ExternalCancel_AddToAny()
}
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void ExternalCancel_GetConsumingEnumerable()
{
BlockingCollection bc = new BlockingCollection();
diff --git a/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionTests.cs b/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionTests.cs
index 893784a05e0361..3f924ce85440da 100644
--- a/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionTests.cs
+++ b/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionTests.cs
@@ -15,7 +15,7 @@ namespace System.Collections.Concurrent.Tests
/// The class that contains the unit tests of the BlockingCollection.
public class BlockingCollectionTests
{
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void TestBasicScenarios()
{
BlockingCollection bc = new BlockingCollection(3);
@@ -53,7 +53,7 @@ public static void TestBasicScenarios()
/// BlockingCollection throws InvalidOperationException when calling CompleteAdding even after adding and taking all elements
///
///
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void TestBugFix544259()
{
int count = 8;
@@ -88,7 +88,7 @@ public static void TestBugFix544259()
// Since the change to wait as part of CTS.Dispose, the ODE no longer occurs
// but we keep the test as a good example of how cleanup of linkedCTS must be carefully handled
// to prevent users of the source CTS mistakenly calling methods on disposed targets.
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void TestBugFix626345()
{
const int noOfProducers = 1;
@@ -152,7 +152,7 @@ public static void TestBugFix626345()
///
/// Making sure if TryTakeFromAny succeeds, it returns the correct index
///
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void TestBugFix914998()
{
var producer1 = new BlockingCollection();
@@ -193,7 +193,7 @@ public static void TestDebuggerAttributes_Null()
/// Tests the default BlockingCollection constructor which initializes a BlockingQueue
///
///
- [Theory]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(-1)]
[InlineData(10)]
public static void TestConstruction(int boundedCapacity)
@@ -230,7 +230,7 @@ public static void TestConstruction(int boundedCapacity)
/// The number of elements to add to the BlockingCollection.
/// The number of elements to Take from the BlockingCollection.
/// The bounded capacity of the BlockingCollection, -1 is unbounded.
- [Theory]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(1, 1, -1)]
[InlineData(5, 3, 1)]
public static void TestAddTake(int numOfAdds, int numOfTakes, int boundedCapacity)
@@ -252,7 +252,7 @@ public static void TestAddTake_Longrunning(int numOfAdds, int numOfTakes, int bo
/// present in the collection.
/// Number of producer threads.
/// Number of elements added per thread.
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(2, 1024)]
[InlineData(8, 512)]
public static void TestConcurrentAdd(int numOfThreads, int numOfElementsPerThread)
@@ -291,7 +291,7 @@ public static void TestConcurrentAdd(int numOfThreads, int numOfElementsPerThrea
/// are consumed by consumers with no element lost nor consumed more than once.
/// Total number of producer and consumer threads.
/// Number of elements to Add/Take per thread.
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(8, 1024)]
public static void TestConcurrentAddTake(int numOfThreads, int numOfElementsPerThread)
{
@@ -464,7 +464,7 @@ public static void Test5_GetEnumerator()
/// Validates GetConsumingEnumerator and makes sure that BlockingCollection.GetConsumingEnumerator()
/// produces the same results as if call Take in a loop.
/// True if test succeeded, false otherwise.
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void Test6_GetConsumingEnumerable()
{
BlockingCollection blockingCollection = ConstructBlockingCollection();
@@ -509,7 +509,7 @@ public static void Test6_GetConsumingEnumerable()
/// to Take will not block waiting for more input, and calls to MoveNext on the enumerator returned from GetEnumerator
/// on the enumerable returned from GetConsumingEnumerable will return false when the collection's count reaches 0.
/// True if test succeeded, false otherwise.
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void Test7_CompleteAdding()
{
BlockingCollection blockingCollection = ConstructBlockingCollection();
@@ -534,7 +534,7 @@ public static void Test7_CompleteAdding()
Assert.Equal(0, counter);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void Test7_ConcurrentAdd_CompleteAdding()
{
BlockingCollection blockingCollection = ConstructBlockingCollection();
@@ -625,7 +625,7 @@ public static void TestCopyTo(int indexOfInsertion)
/// Validates BlockingCollection.Count.
/// True if test succeeded, false otherwise.
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void Test10_Count()
{
BlockingCollection blockingCollection = ConstructBlockingCollection(1);
@@ -655,7 +655,7 @@ public static void Test11_BoundedCapacity()
/// Validates BlockingCollection.IsCompleted and BlockingCollection.AddingIsCompleted.
/// True if test succeeded, false otherwise.
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void Test12_IsCompleted_AddingIsCompleted()
{
BlockingCollection blockingCollection = ConstructBlockingCollection();
@@ -713,7 +713,7 @@ public static void Test13_IsSynchronized_SyncRoot()
/// Length of BlockingCollections array.
/// Index of the BlockingCollection that will accept the operations.
/// The bounded capacity of the BlockingCollection under test.
- [Theory]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(1, 1, 16, 0, -1)]
[InlineData(10, 10, 16, 14, 10)]
public static void TestAddAnyTakeAny(int numOfAdds,
@@ -861,7 +861,7 @@ public static void Test17_AddExceptions()
Assert.Throws(() => bc.Add(1));
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void Test_AddTakeWithReject_DoNotCorruptCount()
{
var secondFalse = new FalseOnSecondAddOrTake();
@@ -994,7 +994,7 @@ public static void Test21_CopyToExceptions()
});
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void Test_WithNullEntries()
{
BlockingCollection collection = new BlockingCollection()
diff --git a/src/libraries/System.Collections.Concurrent/tests/ConcurrentBagTests.cs b/src/libraries/System.Collections.Concurrent/tests/ConcurrentBagTests.cs
index b76b283223aaef..167842e93432ee 100644
--- a/src/libraries/System.Collections.Concurrent/tests/ConcurrentBagTests.cs
+++ b/src/libraries/System.Collections.Concurrent/tests/ConcurrentBagTests.cs
@@ -19,7 +19,7 @@ public class ConcurrentBagTests : ProducerConsumerCollectionTests
protected override string CopyToNoLengthParamName => "index";
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(1, 10)]
[InlineData(3, 100)]
[InlineData(8, 1000)]
@@ -45,7 +45,7 @@ public static void AddThenPeek_LatestLocalItemReturned(int threadsCount, int ite
Assert.Equal(itemsPerThread * threadsCount, bag.Count);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void AddOnOneThread_PeekOnAnother_EnsureWeCanTakeOnTheOriginal()
{
var bag = new ConcurrentBag(Enumerable.Range(1, 5));
@@ -76,7 +76,7 @@ public static void AddOnOneThread_PeekOnAnother_EnsureWeCanTakeOnTheOriginal()
}
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void AddManyItems_ThenTakeOnDifferentThread_ItemsOutputInExpectedOrder()
{
var bag = new ConcurrentBag(Enumerable.Range(0, 100000));
@@ -91,7 +91,7 @@ public static void AddManyItems_ThenTakeOnDifferentThread_ItemsOutputInExpectedO
}, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default).GetAwaiter().GetResult();
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void SingleProducerAdding_MultiConsumerTaking_SemaphoreThrottling_AllTakesSucceed()
{
var bag = new ConcurrentBag();
@@ -147,7 +147,7 @@ public static void SingleProducerAdding_MultiConsumerTaking_SemaphoreThrottling_
ce.Wait();
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(0)]
[InlineData(1)]
[InlineData(10)]
@@ -210,7 +210,7 @@ public static void ICollectionCopyTo_TypeMismatch()
Assert.Throws(() => c.CopyTo(new ArgumentNullException[Size], 0));
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(0)]
[InlineData(1)]
[InlineData(10)]
@@ -260,7 +260,7 @@ public bool TryTake(out int item)
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(false, 0)]
[InlineData(false, 1)]
[InlineData(false, 20)]
@@ -311,7 +311,7 @@ public static void Clear_DuringEnumeration_DoesntAffectEnumeration()
}
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(1, 10)]
[InlineData(3, 100)]
[InlineData(8, 1000)]
diff --git a/src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionaryTests.cs b/src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionaryTests.cs
index 454b6916c2b112..bcebb500d72e39 100644
--- a/src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionaryTests.cs
+++ b/src/libraries/System.Collections.Concurrent/tests/ConcurrentDictionary/ConcurrentDictionaryTests.cs
@@ -13,7 +13,7 @@ namespace System.Collections.Concurrent.Tests
{
public class ConcurrentDictionaryTests
{
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void TestBasicScenarios()
{
ConcurrentDictionary cd = new ConcurrentDictionary();
@@ -975,7 +975,7 @@ public static void TestClear()
Assert.True(dictionary.IsEmpty, "TestClear: FAILED. IsEmpty returned false after Clear");
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void TestTryUpdate()
{
var dictionary = new ConcurrentDictionary();
diff --git a/src/libraries/System.Collections.Concurrent/tests/ConcurrentQueueTests.cs b/src/libraries/System.Collections.Concurrent/tests/ConcurrentQueueTests.cs
index 49ab211a30590b..4b47e82f17ddcd 100644
--- a/src/libraries/System.Collections.Concurrent/tests/ConcurrentQueueTests.cs
+++ b/src/libraries/System.Collections.Concurrent/tests/ConcurrentQueueTests.cs
@@ -20,7 +20,7 @@ public class ConcurrentQueueTests : ProducerConsumerCollectionTests
protected override string CopyToNoLengthParamName => null;
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void Concurrent_Enqueue_TryDequeue_AllItemsReceived()
{
int items = 1000;
@@ -56,7 +56,7 @@ public void Concurrent_Enqueue_TryDequeue_AllItemsReceived()
Task.WaitAll(producer, consumer);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void Concurrent_Enqueue_TryPeek_TryDequeue_AllItemsSeen()
{
int items = 1000;
@@ -90,7 +90,7 @@ public void Concurrent_Enqueue_TryPeek_TryDequeue_AllItemsSeen()
Task.WaitAll(producer, consumer);
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(1, 4, 1024)]
[InlineData(4, 1, 1024)]
[InlineData(3, 3, 1024)]
@@ -246,7 +246,7 @@ public void ReferenceTypes_NulledAfterDequeue()
GC.KeepAlive(queue);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void ManySegments_ConcurrentDequeues_RemainsConsistent()
{
var cq = new ConcurrentQueue();
@@ -276,7 +276,7 @@ public void ManySegments_ConcurrentDequeues_RemainsConsistent()
Assert.Equal(Iters, dequeues);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void ManySegments_ConcurrentEnqueues_RemainsConsistent()
{
var cq = new ConcurrentQueue();
@@ -357,7 +357,7 @@ public static void Clear_DuringEnumeration_DoesntAffectEnumeration()
}
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(1, 10)]
[InlineData(3, 100)]
[InlineData(8, 1000)]
diff --git a/src/libraries/System.Collections.Concurrent/tests/ConcurrentStackTests.cs b/src/libraries/System.Collections.Concurrent/tests/ConcurrentStackTests.cs
index aa0d311810f2ec..ca8d79ae93ca5e 100644
--- a/src/libraries/System.Collections.Concurrent/tests/ConcurrentStackTests.cs
+++ b/src/libraries/System.Collections.Concurrent/tests/ConcurrentStackTests.cs
@@ -94,7 +94,7 @@ public void PushRange_NoItems_NothingAdded_EmptyArrayNoRangeSpecified()
Assert.True(s.IsEmpty);
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(8, 10)]
[InlineData(16, 100)]
[InlineData(128, 100)]
@@ -128,7 +128,7 @@ public void PushRange_Concurrent_ConsecutiveItemsInEachRange(int numThreads, int
}
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(8, 10)]
[InlineData(16, 100)]
[InlineData(128, 100)]
@@ -181,7 +181,7 @@ public void TryPopRange_InvalidArguments_Throws()
AssertExtensions.Throws(null, () => stack.TryPopRange(new int[1], 0, 10));
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void Concurrent_Push_TryPop_WithSuspensions()
{
int items = 10;
diff --git a/src/libraries/System.Collections.Concurrent/tests/PartitionerStaticTests.cs b/src/libraries/System.Collections.Concurrent/tests/PartitionerStaticTests.cs
index 037b166c0df6ec..a821528faf58e5 100644
--- a/src/libraries/System.Collections.Concurrent/tests/PartitionerStaticTests.cs
+++ b/src/libraries/System.Collections.Concurrent/tests/PartitionerStaticTests.cs
@@ -13,7 +13,7 @@ namespace System.Collections.Concurrent.Tests
{
public class PartitionerStaticTests
{
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void TestStaticPartitioningIList()
{
RunTestWithAlgorithm(dataSize: 11, partitionCount: 8, algorithm: 0);
@@ -21,7 +21,7 @@ public static void TestStaticPartitioningIList()
RunTestWithAlgorithm(dataSize: 10000, partitionCount: 11, algorithm: 0);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void TestStaticPartitioningArray()
{
RunTestWithAlgorithm(dataSize: 7, partitionCount: 4, algorithm: 1);
@@ -29,7 +29,7 @@ public static void TestStaticPartitioningArray()
RunTestWithAlgorithm(dataSize: 1000, partitionCount: 7, algorithm: 1);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void TestLoadBalanceIList()
{
RunTestWithAlgorithm(dataSize: 7, partitionCount: 4, algorithm: 2);
@@ -37,7 +37,7 @@ public static void TestLoadBalanceIList()
RunTestWithAlgorithm(dataSize: 1000, partitionCount: 7, algorithm: 2);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void TestLoadBalanceArray()
{
RunTestWithAlgorithm(dataSize: 11, partitionCount: 8, algorithm: 3);
@@ -45,7 +45,7 @@ public static void TestLoadBalanceArray()
RunTestWithAlgorithm(dataSize: 10000, partitionCount: 11, algorithm: 3);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void TestLoadBalanceEnumerator()
{
RunTestWithAlgorithm(dataSize: 7, partitionCount: 4, algorithm: 4);
diff --git a/src/libraries/System.Collections.Concurrent/tests/ProducerConsumerCollectionTests.cs b/src/libraries/System.Collections.Concurrent/tests/ProducerConsumerCollectionTests.cs
index 7aae42fcae3eca..87c01f6374ad98 100644
--- a/src/libraries/System.Collections.Concurrent/tests/ProducerConsumerCollectionTests.cs
+++ b/src/libraries/System.Collections.Concurrent/tests/ProducerConsumerCollectionTests.cs
@@ -97,7 +97,7 @@ public void Ctor_InitializeFromCollection_ContainsExpectedItems(int numItems)
AssertSetsEqual(expected, actual);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void Add_TakeFromAnotherThread_ExpectedItemsTaken()
{
IProducerConsumerCollection c = CreateProducerConsumerCollection();
@@ -186,7 +186,7 @@ public void AddTake_RandomChangesMatchOracle()
Assert.Equal(oracle.Count, c.Count);
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(100, 1, 100, true)]
[InlineData(100, 4, 10, false)]
[InlineData(1000, 11, 100, true)]
@@ -268,7 +268,7 @@ public void ToArray_AddAndTakeItemsIntermixedWithEnumeration_ItemsAndCountMatch(
}
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void AddFromMultipleThreads_ItemsRemainAfterThreadsGoAway()
{
IProducerConsumerCollection c = CreateProducerConsumerCollection();
@@ -336,7 +336,7 @@ public void TryPeek_SucceedsOnEmptyCollectionThatWasOnceNonEmpty()
Assert.Equal(0, item);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void AddTakeWithAtLeastOneElementInCollection_IsEmpty_AlwaysFalse()
{
int items = 1000;
@@ -480,7 +480,7 @@ public void ICollectionCopyTo_InvalidArgs_Throws()
AssertExtensions.Throws(CopyToNoLengthParamName, "", () => c.CopyTo(dest, dest.Length - 2));
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(100, 1, 10)]
[InlineData(4, 100000, 10)]
public void BlockingCollection_WrappingCollection_ExpectedElementsTransferred(int numThreadsPerConsumerProducer, int numItemsPerThread, int producerSpin)
@@ -637,7 +637,7 @@ public void ICollection_IsSynchronized_SyncRoot()
Assert.Throws(() => c.SyncRoot);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void ToArray_ParallelInvocations_Succeed()
{
IProducerConsumerCollection c = CreateProducerConsumerCollection();
@@ -679,7 +679,7 @@ public void ToArray_AddTakeSameThread_ExpectedResultsAfterAddsAndTakes()
}
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void GetEnumerator_ParallelInvocations_Succeed()
{
IProducerConsumerCollection c = CreateProducerConsumerCollection();
@@ -697,7 +697,7 @@ public void GetEnumerator_ParallelInvocations_Succeed()
});
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(1, ConcurrencyTestSeconds / 2)]
[InlineData(4, ConcurrencyTestSeconds / 2)]
public void ManyConcurrentAddsTakes_EnsureTrackedCountsMatchResultingCollection(int threadsPerProc, double seconds)
@@ -766,7 +766,7 @@ public void ManyConcurrentAddsTakes_CollectionRemainsConsistent()
Assert.Empty(c);
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(ConcurrencyTestSeconds)]
public void ManyConcurrentAddsTakesPeeks_ForceContentionWithOtherThreadsTaking(double seconds)
{
@@ -825,7 +825,7 @@ public void ManyConcurrentAddsTakesPeeks_ForceContentionWithOtherThreadsTaking(d
Assert.Equal(remaining, c.Count);
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(ConcurrencyTestSeconds)]
public void ManyConcurrentAddsTakesPeeks_ForceContentionWithOtherThreadsPeeking(double seconds)
{
@@ -878,7 +878,7 @@ public void ManyConcurrentAddsTakesPeeks_ForceContentionWithOtherThreadsPeeking(
Assert.Equal(0, c.Count);
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(ConcurrencyTestSeconds)]
public void ManyConcurrentAddsTakes_ForceContentionWithToArray(double seconds)
{
@@ -915,7 +915,7 @@ public void ManyConcurrentAddsTakes_ForceContentionWithToArray(double seconds)
Assert.Equal(0, c.Count);
}
- [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[InlineData(0, ConcurrencyTestSeconds / 2)]
[InlineData(1, ConcurrencyTestSeconds / 2)]
public void ManyConcurrentAddsTakes_ForceContentionWithGetEnumerator(int initialCount, double seconds)
diff --git a/src/libraries/System.Collections.Immutable/tests/ImmutableArrayTest.cs b/src/libraries/System.Collections.Immutable/tests/ImmutableArrayTest.cs
index 6631b6fd61bd56..bf46ddf5586d55 100644
--- a/src/libraries/System.Collections.Immutable/tests/ImmutableArrayTest.cs
+++ b/src/libraries/System.Collections.Immutable/tests/ImmutableArrayTest.cs
@@ -2507,7 +2507,7 @@ public void OfType()
Assert.Equal(new[] { "1" }, s_twoElementRefTypeWithNull.OfType());
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void AddThreadSafety()
{
// Note the point of this thread-safety test is *not* to test the thread-safety of the test itself.
diff --git a/src/libraries/System.Collections.Immutable/tests/ImmutableInterlockedTests.cs b/src/libraries/System.Collections.Immutable/tests/ImmutableInterlockedTests.cs
index 00a51f122ca0ef..062df38f5adb6c 100644
--- a/src/libraries/System.Collections.Immutable/tests/ImmutableInterlockedTests.cs
+++ b/src/libraries/System.Collections.Immutable/tests/ImmutableInterlockedTests.cs
@@ -114,7 +114,7 @@ public void UpdateArray_NoEffectualChange()
});
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void Update_HighConcurrency()
{
UpdateHelper>(func =>
@@ -147,7 +147,7 @@ public void Update_HighConcurrency()
});
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void UpdateArray_HighConcurrency()
{
UpdateArrayHelper(func =>
@@ -180,7 +180,7 @@ public void UpdateArray_HighConcurrency()
});
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void Update_CarefullyScheduled()
{
UpdateHelper>(func =>
@@ -239,7 +239,7 @@ public void Update_CarefullyScheduled()
});
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void UpdateArray_CarefullyScheduled()
{
UpdateArrayHelper(func =>
diff --git a/src/libraries/System.Collections.NonGeneric/tests/ArrayListTests.cs b/src/libraries/System.Collections.NonGeneric/tests/ArrayListTests.cs
index d1947d28866b7f..176affdffa8fa1 100644
--- a/src/libraries/System.Collections.NonGeneric/tests/ArrayListTests.cs
+++ b/src/libraries/System.Collections.NonGeneric/tests/ArrayListTests.cs
@@ -2568,7 +2568,7 @@ public class ArrayList_SyncRootTests
private ArrayList _arrDaughter;
private ArrayList _arrGrandDaughter;
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void GetSyncRoot()
{
const int NumberOfElements = 100;
@@ -2858,7 +2858,7 @@ public class ArrayList_SynchronizedTests
public ArrayList _arrList;
public Hashtable _hash; // This will verify that threads will only add elements the num of times they are specified to
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void Synchronized_ArrayList()
{
// Make 40 threads which add strHeroes to an ArrayList
@@ -2880,7 +2880,7 @@ public void Synchronized_ArrayList()
Assert.Equal(workers.Length * s_synchronizedTestData.Length, _arrList.Count);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void Synchronized_IList()
{
int iNumberOfWorkers = 10;
diff --git a/src/libraries/System.Collections.NonGeneric/tests/HashtableTests.cs b/src/libraries/System.Collections.NonGeneric/tests/HashtableTests.cs
index 3a62a8ddc68211..4c26c248e8ecf7 100644
--- a/src/libraries/System.Collections.NonGeneric/tests/HashtableTests.cs
+++ b/src/libraries/System.Collections.NonGeneric/tests/HashtableTests.cs
@@ -1163,7 +1163,7 @@ public class Hashtable_SyncRootTests
private Hashtable _hashGrandDaughter;
private const int NumberOfElements = 100;
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void SyncRoot()
{
// Different hashtables have different SyncRoots
diff --git a/src/libraries/System.Collections.NonGeneric/tests/QueueTests.cs b/src/libraries/System.Collections.NonGeneric/tests/QueueTests.cs
index 170dc5ee8c2f8c..9be9eb83a713ed 100644
--- a/src/libraries/System.Collections.NonGeneric/tests/QueueTests.cs
+++ b/src/libraries/System.Collections.NonGeneric/tests/QueueTests.cs
@@ -830,7 +830,7 @@ public class Queue_SyncRootTests
private Queue _queueDaughter;
private Queue _queueGrandDaughter;
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void SyncRoot()
{
var queueMother = new Queue();
@@ -903,7 +903,7 @@ public static void Synchronized()
}
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void SynchronizedEnqueue()
{
// Enqueue
diff --git a/src/libraries/System.Collections.NonGeneric/tests/SortedListTests.cs b/src/libraries/System.Collections.NonGeneric/tests/SortedListTests.cs
index f12e4f1993a72c..ff082bb8d251de 100644
--- a/src/libraries/System.Collections.NonGeneric/tests/SortedListTests.cs
+++ b/src/libraries/System.Collections.NonGeneric/tests/SortedListTests.cs
@@ -1530,7 +1530,7 @@ public class SortedList_SyncRootTests
private SortedList _sortListGrandDaughter;
private const int NumberOfElements = 100;
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
[OuterLoop]
public void GetSyncRootBasic()
{
diff --git a/src/libraries/System.Collections.NonGeneric/tests/StackTests.cs b/src/libraries/System.Collections.NonGeneric/tests/StackTests.cs
index ec794d8bc5c0f3..a5d2db835dbb32 100644
--- a/src/libraries/System.Collections.NonGeneric/tests/StackTests.cs
+++ b/src/libraries/System.Collections.NonGeneric/tests/StackTests.cs
@@ -535,7 +535,7 @@ public class Stack_SyncRootTests
private const int NumberOfElements = 100;
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void GetSyncRootBasic()
{
// Testing SyncRoot is not as simple as its implementation looks like. This is the working
diff --git a/src/libraries/System.ComponentModel.EventBasedAsync/tests/AsyncOperationTests.cs b/src/libraries/System.ComponentModel.EventBasedAsync/tests/AsyncOperationTests.cs
index 1d32eb1d059a0f..910a0cf076e577 100644
--- a/src/libraries/System.ComponentModel.EventBasedAsync/tests/AsyncOperationTests.cs
+++ b/src/libraries/System.ComponentModel.EventBasedAsync/tests/AsyncOperationTests.cs
@@ -11,7 +11,7 @@ public class AsyncOperationTests
{
private const int SpinTimeoutSeconds = 30;
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void Noop()
{
// Test that a simple AsyncOperation can be dispatched and completed via AsyncOperationManager
@@ -27,7 +27,7 @@ public static void Noop()
}).GetAwaiter().GetResult();
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void ThrowAfterAsyncComplete()
{
Task.Run(() =>
@@ -42,7 +42,7 @@ public static void ThrowAfterAsyncComplete()
}).GetAwaiter().GetResult();
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void ThrowAfterSynchronousComplete()
{
Task.Run(() =>
@@ -57,7 +57,7 @@ public static void ThrowAfterSynchronousComplete()
}).GetAwaiter().GetResult();
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void Cancel()
{
// Test that cancellation gets passed all the way through PostOperationCompleted(callback, AsyncCompletedEventArgs)
@@ -77,7 +77,7 @@ public static void Cancel()
}).GetAwaiter().GetResult();
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public static void Throw()
{
// Test that exceptions get passed all the way through PostOperationCompleted(callback, AsyncCompletedEventArgs)
diff --git a/src/libraries/System.ComponentModel.EventBasedAsync/tests/BackgroundWorkerTests.cs b/src/libraries/System.ComponentModel.EventBasedAsync/tests/BackgroundWorkerTests.cs
index 670f201c6960de..8159702ca0e098 100644
--- a/src/libraries/System.ComponentModel.EventBasedAsync/tests/BackgroundWorkerTests.cs
+++ b/src/libraries/System.ComponentModel.EventBasedAsync/tests/BackgroundWorkerTests.cs
@@ -15,7 +15,7 @@ public class BackgroundWorkerTests
private const int TimeoutShort = 300;
private const int TimeoutLong = 30000;
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void TestBackgroundWorkerBasic()
{
var original = SynchronizationContext.Current;
@@ -91,7 +91,7 @@ public async Task RunWorkerAsync_NoOnWorkHandler_SetsResultToNull()
private ManualResetEventSlim manualResetEvent3;
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void TestCancelAsync()
{
BackgroundWorker bw = new BackgroundWorker();
@@ -155,7 +155,7 @@ private void DoWorkExpectCancel(object sender, DoWorkEventArgs e)
#endregion
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void TestThrowExceptionInDoWork()
{
var original = SynchronizationContext.Current;
@@ -208,7 +208,7 @@ public void CtorTest()
Assert.False(bw.CancellationPending);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void RunWorkerAsyncTwice()
{
var bw = new BackgroundWorker();
@@ -233,7 +233,7 @@ public void RunWorkerAsyncTwice()
}
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void TestCancelInsideDoWork()
{
var original = SynchronizationContext.Current;
diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/TimerTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/TimerTests.cs
index 49ebe839ceae8c..d83cab44fd5f65 100644
--- a/src/libraries/System.ComponentModel.TypeConverter/tests/TimerTests.cs
+++ b/src/libraries/System.ComponentModel.TypeConverter/tests/TimerTests.cs
@@ -35,7 +35,7 @@ public void Ctor_PropertiesMatchExpectedDefaults()
}
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void TestTimerStartAutoReset()
{
using (var timer = new TestTimer(1))
diff --git a/src/libraries/System.Composition/tests/ConcurrencyTests.cs b/src/libraries/System.Composition/tests/ConcurrencyTests.cs
index 6801f55a57d32e..2c465aa253e55e 100644
--- a/src/libraries/System.Composition/tests/ConcurrencyTests.cs
+++ b/src/libraries/System.Composition/tests/ConcurrencyTests.cs
@@ -27,7 +27,7 @@ public void OnImportsSatisfied()
// This does not test the desired behaviour deterministically,
// but is close enough to be repeatable at least on my machine :)
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void SharedInstancesAreNotVisibleUntilActivationCompletes()
{
var c = CreateContainer(typeof(PausesDuringActivation));
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs
index ae3c138e369714..a93bc6b62edff9 100644
--- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs
+++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs
@@ -384,7 +384,7 @@ public void IsStoppedTest()
///
/// Tests Id generation
///
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void IdGenerationNoParent()
{
var orphan1 = new Activity("orphan1");
@@ -400,7 +400,7 @@ public void IdGenerationNoParent()
///
/// Tests Id generation
///
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void IdGenerationInternalParent()
{
var parent = new Activity("parent");
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/DiagnosticSourceTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/DiagnosticSourceTests.cs
index f8ca97c501ccd5..aee7547bff0a1e 100644
--- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/DiagnosticSourceTests.cs
+++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/DiagnosticSourceTests.cs
@@ -367,7 +367,7 @@ public void MultiSubscriber()
/// Stresses the Subscription routine by having many threads subscribe and
/// unsubscribe concurrently
///
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void MultiSubscriberStress()
{
using (DiagnosticListener listener = new DiagnosticListener("MultiSubscriberStressTest"))
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/TestWithConfigSwitches/ActivityTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TestWithConfigSwitches/ActivityTests.cs
index 808e1c779ef1b6..0b6a42ffa32f8a 100644
--- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/TestWithConfigSwitches/ActivityTests.cs
+++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TestWithConfigSwitches/ActivityTests.cs
@@ -32,7 +32,7 @@ public void ActivityIdNonHierarchicalOverflow()
Assert.DoesNotContain('#', activity.Id);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void IdGenerationInternalParent()
{
var parent = new Activity("parent");
diff --git a/src/libraries/System.IO.Pipelines/tests/FlushAsyncCancellationTests.cs b/src/libraries/System.IO.Pipelines/tests/FlushAsyncCancellationTests.cs
index a5a61579d9787c..1284f1fac5984b 100644
--- a/src/libraries/System.IO.Pipelines/tests/FlushAsyncCancellationTests.cs
+++ b/src/libraries/System.IO.Pipelines/tests/FlushAsyncCancellationTests.cs
@@ -12,7 +12,7 @@ namespace System.IO.Pipelines.Tests
{
public class FlushAsyncCancellationTests : PipeTest
{
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void FlushAsyncCancellationDeadlock()
{
var cts = new CancellationTokenSource();
diff --git a/src/libraries/System.IO.Pipelines/tests/ReadAsyncCancellationTests.cs b/src/libraries/System.IO.Pipelines/tests/ReadAsyncCancellationTests.cs
index fb17873b6a1c56..87b28dad247122 100644
--- a/src/libraries/System.IO.Pipelines/tests/ReadAsyncCancellationTests.cs
+++ b/src/libraries/System.IO.Pipelines/tests/ReadAsyncCancellationTests.cs
@@ -134,7 +134,7 @@ public async Task CancellingPendingReadBeforeReadAsync()
Pipe.Reader.AdvanceTo(buffer.Start, buffer.Start);
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void ReadAsyncCancellationDeadlock()
{
var cts = new CancellationTokenSource();
diff --git a/src/libraries/System.Linq.Expressions/tests/Dynamic/CallSiteCachingTests.cs b/src/libraries/System.Linq.Expressions/tests/Dynamic/CallSiteCachingTests.cs
index cc829df8a32864..f04ab35cef23b6 100644
--- a/src/libraries/System.Linq.Expressions/tests/Dynamic/CallSiteCachingTests.cs
+++ b/src/libraries/System.Linq.Expressions/tests/Dynamic/CallSiteCachingTests.cs
@@ -223,7 +223,7 @@ public void BinderCacheFlushWhenTooBig()
}
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))]
public void ConcurrentAdds()
{
for (int i = 0; i < 10; i++)
diff --git a/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs b/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs
index 6dcaffbf60a5a5..ee31024b2b8745 100644
--- a/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs
+++ b/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs
@@ -88,7 +88,7 @@ public static IEnumerable