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 AllMergeOptions_Multiple() // The basic tests are covered elsewhere, although without WithDegreeOfParallelism // or WithMergeOptions - [ConditionalTheory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(PartitioningData), new[] { 0, 1, 2, 16, 1024 })] public static void Partitioning_Default(Labeled> labeled, int count, int partitions) { @@ -105,7 +105,7 @@ public static void Partitioning_Default(Labeled> labeled, int } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] [MemberData(nameof(PartitioningData), new int[] { /* Sources.OuterLoopCount */ })] public static void Partitioning_Default_Longrunning(Labeled> labeled, int count, int partitions) @@ -113,7 +113,7 @@ public static void Partitioning_Default_Longrunning(Labeled> Partitioning_Default(labeled, count, partitions); } - [ConditionalTheory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(PartitioningData), new[] { 0, 1, 2, 16, 1024 })] public static void Partitioning_Striped(Labeled> labeled, int count, int partitions) { @@ -129,7 +129,7 @@ public static void Partitioning_Striped(Labeled> labeled, int } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] [MemberData(nameof(PartitioningData), new int[] { /* Sources.OuterLoopCount */ })] public static void Partitioning_Striped_Longrunning(Labeled> labeled, int count, int partitions) @@ -157,7 +157,7 @@ public static void Merge_Ordered_Longrunning(Labeled> labeled Merge_Ordered(labeled, count, options); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(ThrowOnCount_AllMergeOptions_MemberData), new[] { 4, 8 })] // FailingMergeData has enumerables that throw errors when attempting to perform the nth enumeration. // This test checks whether the query runs in a pipelined or buffered fashion. @@ -166,7 +166,7 @@ public static void Merge_Ordered_Pipelining(Labeled> labeled, Assert.Equal(0, labeled.Item.WithDegreeOfParallelism(count - 1).WithMergeOptions(options).First()); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(MergeData), new[] { 4, 8 })] // This test checks whether the query runs in a pipelined or buffered fashion. public static void Merge_Ordered_Pipelining_Select(Labeled> labeled, int count, ParallelMergeOptions options) @@ -230,7 +230,7 @@ public static void PlinqChunkPartitioner_DontEnumerateAfterException( // disposes the enumerator when it is finished. If an exception occurs, the calling // enumerator disposes the source enumerator... but then other worker threads may generate ODEs. // This test verifies any such ODEs are not reflected in the output exception. - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(UnorderedSources.BinaryRanges), new[] { 16 }, new[] { 16 }, MemberType = typeof(UnorderedSources))] public static void ManualChunkPartitioner_DontEnumerateAfterException( Labeled> left, int leftCount, diff --git a/src/libraries/System.Linq.Parallel/tests/PlinqModesTests.cs b/src/libraries/System.Linq.Parallel/tests/PlinqModesTests.cs index b6b8b626c51588..d65daa97deb77d 100644 --- a/src/libraries/System.Linq.Parallel/tests/PlinqModesTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/PlinqModesTests.cs @@ -135,7 +135,7 @@ public static IEnumerable AllExecutionModes_Multiple() } // Check that some queries run in parallel by default, and some require forcing. - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(WithExecutionModeQueryData), new[] { 1, 4 })] // DOP of 1 to verify sequential and 4 to verify parallel public static void WithExecutionMode( Labeled> labeled, diff --git a/src/libraries/System.Linq.Parallel/tests/QueryOperators/GetEnumeratorTests.cs b/src/libraries/System.Linq.Parallel/tests/QueryOperators/GetEnumeratorTests.cs index d34cc6e903bc9c..1840ce7ded3829 100644 --- a/src/libraries/System.Linq.Parallel/tests/QueryOperators/GetEnumeratorTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/QueryOperators/GetEnumeratorTests.cs @@ -164,7 +164,7 @@ public static void GetEnumerator_MoveNextAfterEnd(Labeled> la Assert.False(enumerator.MoveNext()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void GetEnumerator_LargeQuery_PauseAfterOpening() { using (IEnumerator e = Enumerable.Range(0, 8192).AsParallel().SkipWhile(i => true).GetEnumerator()) diff --git a/src/libraries/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs b/src/libraries/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs index 0d920b5d13f782..c52482ab405c0d 100644 --- a/src/libraries/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs @@ -503,7 +503,7 @@ public static void OrderByDescending_ArgumentNullException() // On CTP-M1, this would deadlock for DOP=7,9,11,... on 4-core, but works for DOP=1..6 and 8,10,12, ... // // In this test, every call to the key-selector delegate throws. - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(OrderByThreadedData), new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })] public static void OrderBy_ThreadedDeadlock(Labeled> labeled, int count, int degree) { @@ -515,7 +515,7 @@ public static void OrderBy_ThreadedDeadlock(Labeled> labeled, } // Heavily exercises OrderBy, but only throws one user delegate exception to simulate an occasional failure. - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(OrderByThreadedData), new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })] public static void OrderBy_ThreadedDeadlock_SingleException(Labeled> labeled, int count, int degree) { diff --git a/src/libraries/System.Linq/tests/SelectTests.cs b/src/libraries/System.Linq/tests/SelectTests.cs index e1c642ae31620c..39c66fc5fc4348 100644 --- a/src/libraries/System.Linq/tests/SelectTests.cs +++ b/src/libraries/System.Linq/tests/SelectTests.cs @@ -76,7 +76,7 @@ public void EmptyWithIndexedSelector() Assert.Equal(Enumerable.Empty(), Enumerable.Empty().Select((s, i) => s.Length + i)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void EnumerateFromDifferentThread() { var selected = Enumerable.Range(0, 100).Where(i => i > 3).Select(i => i.ToString()); diff --git a/src/libraries/System.Net.WebSockets/tests/WebSocketDeflateTests.cs b/src/libraries/System.Net.WebSockets/tests/WebSocketDeflateTests.cs index d0fa5bea4a4a5d..5092e024f06981 100644 --- a/src/libraries/System.Net.WebSockets/tests/WebSocketDeflateTests.cs +++ b/src/libraries/System.Net.WebSockets/tests/WebSocketDeflateTests.cs @@ -67,7 +67,7 @@ public async Task ReceiveHelloWithContextTakeover() Assert.Equal("Hello", Encoding.UTF8.GetString(buffer.Span)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task SendHelloWithContextTakeover() { WebSocketTestStream stream = new(); @@ -164,7 +164,7 @@ public async Task ReceiveHelloWithoutContextTakeover() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task SendHelloWithoutContextTakeover() { WebSocketTestStream stream = new(); diff --git a/src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs b/src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs index 85f2fd9fdf7f10..742e006fc00444 100644 --- a/src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs +++ b/src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs @@ -68,7 +68,7 @@ public static void ReadAfterInitializationWithTextReaderOnAsyncReaderDoesNotThro } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ReadAsyncAfterInitializationWithUriThrows() { using (XmlReader reader = XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = true })) @@ -77,7 +77,7 @@ public static void ReadAsyncAfterInitializationWithUriThrows() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ReadAfterInitializationWithUriOnAsyncReaderTrows() { using (XmlReader reader = XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = true })) @@ -86,13 +86,13 @@ public static void ReadAfterInitializationWithUriOnAsyncReaderTrows() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void InitializationWithUriOnNonAsyncReaderThrows() { Assert.Throws(() => XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = false })); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [ActiveIssue("https://github.com/dotnet/runtime/issues/53987", TestRuntimes.Mono)] public static void SynchronizationContextCurrent_NotUsedForAsyncOperations() { diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs index 56943320ce5a4e..9e7ee094341274 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs @@ -2879,7 +2879,7 @@ public void Handles() Assert.Equal(handle.RowId, assemblyRef.RowId); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void CanReadFromSameMemoryMappedPEReaderInParallel() { // See http://roslyn.codeplex.com/workitem/299 diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/BackgroundExec/System.Runtime.InteropServices.JavaScript.BackgroundExec.Tests.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/BackgroundExec/System.Runtime.InteropServices.JavaScript.BackgroundExec.Tests.csproj deleted file mode 100644 index 506fcc01f008ac..00000000000000 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/BackgroundExec/System.Runtime.InteropServices.JavaScript.BackgroundExec.Tests.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - <_XUnitBackgroundExec Condition="'$(_XUnitBackgroundExec)' == ''">true - System.Runtime.InteropServices.JavaScript.Tests - - - diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/WebWorkerTest.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/WebWorkerTest.cs index 28c2c5c0f06c10..57349f69c8921e 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/WebWorkerTest.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/WebWorkerTest.cs @@ -438,7 +438,8 @@ await executor.Execute(async () => }, cts.Token); } - [Theory, MemberData(nameof(GetTargetThreadsAndBlockingCalls))] + [MemberData(nameof(GetTargetThreadsAndBlockingCalls))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndNotBlockingWait))] public async Task WaitAssertsOnJSInteropThreads(Executor executor, NamedCall method) { using var cts = CreateTestCaseTimeoutSource(); diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs index 59e6be759b4a09..c5f90a69659354 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs @@ -15,7 +15,7 @@ public static class XmlDictionaryWriterTest { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void XmlBaseWriter_WriteBase64Async() { string actual; @@ -62,7 +62,7 @@ public static void XmlBaseWriter_WriteBinHex() Assert.Equal(expect, actual); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void XmlBaseWriter_FlushAsync() { string actual = null; @@ -142,7 +142,7 @@ public static void XmlBaseWriter_WriteStartEndElementAsync() Assert.Equal(expect, actual); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void XmlBaseWriter_CheckAsync_ThrowInvalidOperationException() { int byteSize = 1024; diff --git a/src/libraries/System.Runtime/tests/System.Buffers.Tests/ArrayPool/UnitTests.cs b/src/libraries/System.Runtime/tests/System.Buffers.Tests/ArrayPool/UnitTests.cs index d58a8838d90a97..bec079671e1e29 100644 --- a/src/libraries/System.Runtime/tests/System.Buffers.Tests/ArrayPool/UnitTests.cs +++ b/src/libraries/System.Runtime/tests/System.Buffers.Tests/ArrayPool/UnitTests.cs @@ -272,7 +272,7 @@ public static void RentingReturningThenRentingABufferShouldNotAllocate() Assert.Equal(id, bt.GetHashCode()); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedOrBrowserBackgroundExec))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(BytePoolInstances))] public static void CanRentManySizedBuffers(ArrayPool pool) { @@ -561,7 +561,7 @@ public static void RentAndReturnManyOfTheSameSize_NoneAreSame(ArrayPool po } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(BytePoolInstances))] public static void UsePoolInParallel(ArrayPool pool) { diff --git a/src/libraries/System.Runtime/tests/System.Globalization.Tests/CultureInfo/CultureInfoAsync.cs b/src/libraries/System.Runtime/tests/System.Globalization.Tests/CultureInfo/CultureInfoAsync.cs index 1e9eb7b7555bc8..e10a93da4a1f66 100644 --- a/src/libraries/System.Runtime/tests/System.Globalization.Tests/CultureInfo/CultureInfoAsync.cs +++ b/src/libraries/System.Runtime/tests/System.Globalization.Tests/CultureInfo/CultureInfoAsync.cs @@ -29,7 +29,7 @@ public void TestCurrentCulturesAsync() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void TestCurrentCulturesWithAwait() { var newCurrentCulture = new CultureInfo(CultureInfo.CurrentCulture.Name.Equals("ja-JP", StringComparison.OrdinalIgnoreCase) ? "en-US" : "ja-JP"); diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/CopyToAsync.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/CopyToAsync.cs index 5a8a84679c5520..53d9eeb3fd8462 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/CopyToAsync.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/CopyToAsync.cs @@ -135,7 +135,7 @@ public static IEnumerable File_AllDataCopied_MemberData() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(false)] [InlineData(true)] public async Task DerivedFileStream_ReadAsyncInvoked(bool useAsync) diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ReadWriteSpan.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ReadWriteSpan.cs index 7cebea9b8d5043..1bc4fda5d1e87a 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ReadWriteSpan.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ReadWriteSpan.cs @@ -28,7 +28,7 @@ public void CallSpanReadWriteOnDerivedFileStream_ArrayMethodsUsed() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task CallMemoryReadWriteAsyncOnDerivedFileStream_ArrayMethodsUsed() { using (var fs = new DerivedFileStream(GetTestFilePath(), FileMode.Create, FileAccess.ReadWrite, FileShare.None, bufferSize: 0x1000, FileOptions.None)) diff --git a/src/libraries/System.Runtime/tests/System.IO.Tests/Stream/Stream.NullTests.cs b/src/libraries/System.Runtime/tests/System.IO.Tests/Stream/Stream.NullTests.cs index 86ebfba5efbefb..3bfa50924e6eaf 100644 --- a/src/libraries/System.Runtime/tests/System.IO.Tests/Stream/Stream.NullTests.cs +++ b/src/libraries/System.Runtime/tests/System.IO.Tests/Stream/Stream.NullTests.cs @@ -194,7 +194,7 @@ public static async Task TestCanceledNullTextReaderAsync(TextReader input) input.Dispose(); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(NullWriters))] public static void TextNullTextWriter(TextWriter output) { diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/EnvironmentTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/EnvironmentTests.cs index 4f30dfd0a09b0d..aa33c7a30d5555 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/EnvironmentTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/EnvironmentTests.cs @@ -58,7 +58,7 @@ public void CurrentManagedThreadId_Idempotent() Assert.Equal(Environment.CurrentManagedThreadId, Environment.CurrentManagedThreadId); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void CurrentManagedThreadId_DifferentForActiveThreads() { var ids = new HashSet(); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Progress.cs b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Progress.cs index 8fd7a61603ecea..967a97b287e99d 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Progress.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Progress.cs @@ -17,7 +17,7 @@ public void Ctor() Assert.Throws(() => new Progress(null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void NoWorkQueuedIfNoHandlers() { RunWithoutSyncCtx(() => @@ -32,7 +32,7 @@ public void NoWorkQueuedIfNoHandlers() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void TargetsCurrentSynchronizationContext() { RunWithoutSyncCtx(() => @@ -47,7 +47,7 @@ public void TargetsCurrentSynchronizationContext() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void EventRaisedWithActionHandler() { RunWithoutSyncCtx(() => @@ -66,7 +66,7 @@ public void EventRaisedWithActionHandler() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void EventRaisedWithEventHandler() { RunWithoutSyncCtx(() => diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Random.cs b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Random.cs index 27cfa26920e064..6f1b11ac972e45 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Random.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Extensions.Tests/System/Random.cs @@ -507,7 +507,7 @@ public void Empty_Success(bool derived, bool seeded) r.NextBytes(Span.Empty); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Shared_IsSingleton() { Assert.NotNull(Random.Shared); @@ -515,7 +515,7 @@ public void Shared_IsSingleton() Assert.Same(Random.Shared, Task.Run(() => Random.Shared).Result); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Shared_ParallelUsage() { using var barrier = new Barrier(2); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Runtime/CompilerServices/ConditionalWeakTableTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Runtime/CompilerServices/ConditionalWeakTableTests.cs index c535ab341dd1b9..dbab47f97df34c 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Runtime/CompilerServices/ConditionalWeakTableTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Runtime/CompilerServices/ConditionalWeakTableTests.cs @@ -166,7 +166,7 @@ public static void Concurrent_AddMany_DropReferences() // no asserts, just makin } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void Concurrent_Add_Read_Remove_DifferentObjects() { var cwt = new ConditionalWeakTable(); @@ -185,7 +185,7 @@ public static void Concurrent_Add_Read_Remove_DifferentObjects() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void Concurrent_GetValue_Read_Remove_DifferentObjects() { var cwt = new ConditionalWeakTable(); @@ -203,7 +203,7 @@ public static void Concurrent_GetValue_Read_Remove_DifferentObjects() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void Concurrent_GetValue_Read_Remove_SameObject() { object key = new object(); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/CESchedulerPairTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/CESchedulerPairTests.cs index 7bc44998523a44..8386e1400f7dfe 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/CESchedulerPairTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/CESchedulerPairTests.cs @@ -87,7 +87,7 @@ public class CESchedulerPairTests /// and those parameters are respected when tasks are executed /// /// maxItemsPerTask and which scheduler is used are verified in other testcases - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData("default")] [InlineData("scheduler")] [InlineData("maxconcurrent")] @@ -183,7 +183,7 @@ public static void TestCreationOptions(string ctorType) /// is that each time ConcurrentExclusiveScheduler is called QueueTasK a counter (which acts as scheduler's Task id) is incremented. /// When a task executes, it observes the parent Task Id and if it matches the one its local cache, it increments its local counter (which tracks /// the items executed by a ConcurrentExclusiveScheduler Task). At any given time the Task's local counter cant exceed maxItemsPerTask - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(4, 1, true)] [InlineData(1, 4, true)] [InlineData(4, 1, false)] @@ -258,7 +258,7 @@ public static void TestMaxItemsPerTask(int maxConcurrency, int maxItemsPerTask, /// When user specifies a concurrency level above the level allowed by the task scheduler, the concurrency level should be set /// to the concurrencylevel specified in the taskscheduler. Also tests that the maxConcurrencyLevel specified was respected /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestLowerConcurrencyLevel() { //a custom scheduler with maxConcurrencyLevel of one @@ -295,7 +295,7 @@ public static void TestLowerConcurrencyLevel() Task.WaitAll(taskList.ToArray()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestConcurrentBlockage() { ConcurrentExclusiveSchedulerPair schedPair = new ConcurrentExclusiveSchedulerPair(); @@ -328,7 +328,7 @@ public static void TestConcurrentBlockage() Task.WaitAll(taskList.ToArray()); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(ApiType))] public static void TestIntegration(string apiType, bool useReader) { @@ -362,7 +362,7 @@ public static void TestInvalidParameters() /// /// Test to ensure completion task works successfully /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestCompletionTask() { // Completion tasks is valid after initialization @@ -415,7 +415,7 @@ public static void TestCompletionTask() /// /// Ensure that CESPs can be layered on other CESPs. /// - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(true)] [InlineData(false)] public static void TestConcurrentExclusiveChain(bool syncContinuations) diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/CancellationTokenTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/CancellationTokenTests.cs index 72df26fa4c9886..ab14b98e5e2f36 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/CancellationTokenTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/CancellationTokenTests.cs @@ -873,7 +873,7 @@ static void FinalizeHelper(DisposeTracker disposeTracker) } // Several tests for deriving custom user types from CancellationTokenSource - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void DerivedCancellationTokenSource() { // Verify that a derived CTS is functional @@ -991,7 +991,7 @@ public static void DerivedCancellationTokenSource_Negative() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancellationTokenSourceWithTimer() { TimeSpan bigTimeSpan = new TimeSpan(2000, 0, 0, 0, 0); @@ -1358,7 +1358,7 @@ public static void Bug720327_DeregisterFromWithinACallbackIsSafe_SyncContextTest SetSynchronizationContext(prevailingSyncCtx); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancellationTokenRegistration_DisposeDuringCancellation_SuccessfullyRemovedIfNotYetInvoked() { var ctr0running = new ManualResetEventSlim(); @@ -1438,7 +1438,7 @@ public static void CancellationTokenRegistration_UnregisterRemovesDelegate() Assert.False(invoked); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancellationTokenRegistration_UnregisterWhileCallbackRunning_UnregisterDoesntWaitForCallbackToComplete() { using (var barrier = new Barrier(2)) @@ -1460,7 +1460,7 @@ public static void CancellationTokenRegistration_UnregisterWhileCallbackRunning_ } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancellationTokenRegistration_UnregisterDuringCancellation_SuccessfullyRemovedIfNotYetInvoked() { var ctr0running = new ManualResetEventSlim(); @@ -1682,7 +1682,7 @@ public static async Task CancellationTokenRegistration_DisposeAsyncWhileCallback } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static async Task CancellationTokenRegistration_DisposeAsyncDuringCancellation_SuccessfullyRemovedIfNotYetInvoked() { var ctr0running = new ManualResetEventSlim(); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/MethodCoverage.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/MethodCoverage.cs index 3509d10843bcbd..eb7a2e75998a88 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/MethodCoverage.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/MethodCoverage.cs @@ -13,7 +13,7 @@ namespace TaskCoverage public class Coverage { // Regression test: Validates that tasks can wait on int.MaxValue without assertion. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWait_MaxInt32() { Task t = Task.Delay(1); @@ -89,7 +89,7 @@ public static void TaskContinuation() /// /// Test various Task.WhenAll and Wait overloads - EH /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitWithCTS() { ManualResetEvent mre = new ManualResetEvent(false); @@ -138,7 +138,7 @@ public static void TaskWaitWithCTS() /// /// test WaitAny and when Any overloads /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAny_WhenAny() { ManualResetEvent mre = new ManualResetEvent(false); @@ -278,7 +278,7 @@ public static async Task Task_WhenAny_TwoTasks_WakesOnFirstCompletion() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancellationTokenRegitration() { ManualResetEvent mre = new ManualResetEvent(false); @@ -295,7 +295,7 @@ public static void CancellationTokenRegitration() /// /// verify that the taskawaiter.UnsafeOnCompleted is invoked /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskAwaiter() { ManualResetEvent mre = new ManualResetEvent(false); @@ -315,7 +315,7 @@ public static void TaskAwaiter() /// /// verify that the taskawaiter.UnsafeOnCompleted is invoked /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskConfigurableAwaiter() { ManualResetEvent mre = new ManualResetEvent(false); @@ -335,7 +335,7 @@ public static void TaskConfigurableAwaiter() /// /// FromAsync testing: Not supported in .NET Native /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void FromAsync() { Task emptyTask = new Task(() => { }); @@ -788,7 +788,7 @@ public static void Task_WhenAll_TwoTasks_WakesOnBothCompletionWithCancellationFo } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void Task_WhenAll_TwoTasks_WakesOnBothCompletionWithSameCancellationForBoth() { // Non-generic, first completes first diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/AsyncTaskMethodBuilderTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/AsyncTaskMethodBuilderTests.cs index 4364e917eeac7a..74f8df7489f82e 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/AsyncTaskMethodBuilderTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/AsyncTaskMethodBuilderTests.cs @@ -488,7 +488,7 @@ public static void FaultedTaskExceptions() } // Test that OCEs don't result in the unobserved event firing - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancellationDoesntResultInEventFiring() { var cts = new CancellationTokenSource(); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/TaskAwaiterTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/TaskAwaiterTests.cs index 1a4032119ed972..6913799bdc1b33 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/TaskAwaiterTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/TaskAwaiterTests.cs @@ -10,7 +10,7 @@ namespace System.Threading.Tasks.Tests { public class TaskAwaiterTests { - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(false, false)] [InlineData(false, true)] [InlineData(false, null)] @@ -66,7 +66,7 @@ public static void OnCompleted_CompletesInAnotherSynchronizationContext(bool gen } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(false, false)] [InlineData(false, true)] [InlineData(false, null)] @@ -123,7 +123,7 @@ public static void OnCompleted_CompletesInAnotherTaskScheduler(bool generic, boo } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task Await_TaskCompletesOnNonDefaultSyncCtx_ContinuesOnDefaultSyncCtx() { await Task.Run(async delegate // escape xunit's sync context @@ -153,7 +153,7 @@ await Task.Run(async delegate // escape xunit's sync context }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task Await_TaskCompletesOnNonDefaultScheduler_ContinuesOnDefaultScheduler() { await Task.Run(async delegate // escape xunit's sync context @@ -179,7 +179,7 @@ public static IEnumerable Await_MultipleAwaits_FirstCompletesAccording yield return new object[] { numContinuations, runContinuationsAsynchronously, valueTask, scheduler }; } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(Await_MultipleAwaits_FirstCompletesAccordingToOptions_RestCompleteAsynchronously_MemberData))] public async Task Await_MultipleAwaits_FirstCompletesAccordingToOptions_RestCompleteAsynchronously( int numContinuations, bool runContinuationsAsynchronously, bool valueTask, object scheduler) @@ -476,7 +476,7 @@ public static void AwaiterAndAwaitableEquality() Assert.NotEqual(task.ConfigureAwait(true).GetAwaiter(), task.ConfigureAwait(false).GetAwaiter()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void BaseSynchronizationContext_SameAsNoSynchronizationContext() { var quwi = new QUWITaskScheduler(); @@ -513,7 +513,7 @@ public static void BaseSynchronizationContext_SameAsNoSynchronizationContext() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(CanceledTasksAndExpectedCancellationExceptions))] public static void OperationCanceledException_PropagatesThroughCanceledTask(int lineNumber, Task task, OperationCanceledException expected) { @@ -593,7 +593,7 @@ public void ConfigureAwaitOptions_ForceYielding_IsCompletedAlwaysFalse(Configure } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void ConfigureAwaitOptions_SuppressThrowing_NoExceptionsAreThrown() { Task t; @@ -611,7 +611,7 @@ public void ConfigureAwaitOptions_SuppressThrowing_NoExceptionsAreThrown() Assert.Throws(() => t.ConfigureAwait(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.ForceYielding).GetAwaiter().GetResult()); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(false, ConfigureAwaitOptions.None)] [InlineData(false, ConfigureAwaitOptions.ContinueOnCapturedContext)] [InlineData(true, ConfigureAwaitOptions.None)] diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/YieldAwaitableTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/YieldAwaitableTests.cs index b59975389042be..1d077df6774146 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/YieldAwaitableTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/YieldAwaitableTests.cs @@ -14,7 +14,7 @@ namespace System.Threading.Tasks.Tests public class YieldAwaitableTests { // awaiting Task.Yield - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunAsyncYieldAwaiterTests() { // Test direct usage works even though it's not encouraged diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/AsyncEnumerableToBlockingEnumerableTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/AsyncEnumerableToBlockingEnumerableTests.cs index 0692aedb514f9e..443c049df3c395 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/AsyncEnumerableToBlockingEnumerableTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/AsyncEnumerableToBlockingEnumerableTests.cs @@ -11,7 +11,7 @@ namespace System.Threading.Tasks.Tests public class AsyncEnumerableToBlockingEnumerableTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void EmptyAsyncEnumerable() { var source = new InstrumentedAsyncEnumerable(CreateSourceEnumerable()); @@ -34,7 +34,7 @@ static async IAsyncEnumerable CreateSourceEnumerable() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void SimpleAsyncEnumerable() { var source = new InstrumentedAsyncEnumerable(CreateSourceEnumerable()); @@ -69,7 +69,7 @@ static async IAsyncEnumerable CreateSourceEnumerable() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void AsyncEnumerableWithDelays() { var source = new InstrumentedAsyncEnumerable(CreateSourceEnumerable()); @@ -103,7 +103,7 @@ static async IAsyncEnumerable CreateSourceEnumerable() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void AsyncEnumerableWithException() { var source = new InstrumentedAsyncEnumerable(CreateSourceEnumerable()); @@ -131,7 +131,7 @@ static async IAsyncEnumerable CreateSourceEnumerable() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void AsyncEnumerableWithCancellation() { var source = new InstrumentedAsyncEnumerable(CreateSourceEnumerable()); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskCancelWaitTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskCancelWaitTests.cs index 68f74885dae12d..9fb5db8d08e534 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskCancelWaitTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskCancelWaitTests.cs @@ -10,7 +10,7 @@ public sealed class TaskCancelWaitTestCases { #region Test Methods - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait1() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Heavy, string.Empty, true); @@ -23,7 +23,7 @@ public static void TaskCancelWait1() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait2() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Light, "AttachedToParent"); @@ -38,7 +38,7 @@ public static void TaskCancelWait2() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait3() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.VeryHeavy, "LongRunning, AttachedToParent"); @@ -59,7 +59,7 @@ public static void TaskCancelWait3() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait4() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Light, "AttachedToParent"); @@ -72,7 +72,7 @@ public static void TaskCancelWait4() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait5() { @@ -84,7 +84,7 @@ public static void TaskCancelWait5() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait6() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Medium, "RespectParentCancellation"); @@ -106,7 +106,7 @@ public static void TaskCancelWait6() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait7() { @@ -130,7 +130,7 @@ public static void TaskCancelWait7() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait8() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Heavy, "LongRunning, RespectParentCancellation"); @@ -156,7 +156,7 @@ public static void TaskCancelWait8() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait9() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Heavy, "None"); @@ -170,7 +170,7 @@ public static void TaskCancelWait9() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait10() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.VeryHeavy, "RespectParentCancellation"); @@ -186,7 +186,7 @@ public static void TaskCancelWait10() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait11() { @@ -210,7 +210,7 @@ public static void TaskCancelWait11() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait12() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Medium, "AttachedToParent"); @@ -226,7 +226,7 @@ public static void TaskCancelWait12() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait13() { @@ -252,7 +252,7 @@ public static void TaskCancelWait13() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait14() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.VeryLight, "AttachedToParent"); @@ -262,7 +262,7 @@ public static void TaskCancelWait14() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait15() { @@ -284,7 +284,7 @@ public static void TaskCancelWait15() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait16() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Heavy, "LongRunning, AttachedToParent"); @@ -294,7 +294,7 @@ public static void TaskCancelWait16() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait17() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Light, "LongRunning, AttachedToParent"); @@ -316,7 +316,7 @@ public static void TaskCancelWait17() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait18() { @@ -342,7 +342,7 @@ public static void TaskCancelWait18() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait19() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Medium, "LongRunning, AttachedToParent"); @@ -353,7 +353,7 @@ public static void TaskCancelWait19() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait20() { @@ -375,7 +375,7 @@ public static void TaskCancelWait20() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait21() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Heavy, "LongRunning"); @@ -400,7 +400,7 @@ public static void TaskCancelWait21() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait22() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Light, "RespectParentCancellation"); @@ -414,7 +414,7 @@ public static void TaskCancelWait22() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait23() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.VeryHeavy, "LongRunning, RespectParentCancellation"); @@ -427,7 +427,7 @@ public static void TaskCancelWait23() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait24() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Medium, "LongRunning"); @@ -442,7 +442,7 @@ public static void TaskCancelWait24() TaskCancelWaitTest test = new TaskCancelWaitTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCancelWait25() { TaskInfo node = new TaskInfo(null, "node", WorkloadType.Heavy, "RespectParentCancellation"); @@ -465,7 +465,7 @@ public static void TaskCancelWait25() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait26() { @@ -480,7 +480,7 @@ public static void TaskCancelWait26() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait27() { @@ -503,7 +503,7 @@ public static void TaskCancelWait27() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait28() { @@ -530,7 +530,7 @@ public static void TaskCancelWait28() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait29() { @@ -547,7 +547,7 @@ public static void TaskCancelWait29() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait30() { @@ -571,7 +571,7 @@ public static void TaskCancelWait30() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait31() { @@ -583,7 +583,7 @@ public static void TaskCancelWait31() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait32() { @@ -595,7 +595,7 @@ public static void TaskCancelWait32() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait33() { @@ -618,7 +618,7 @@ public static void TaskCancelWait33() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait34() { @@ -642,7 +642,7 @@ public static void TaskCancelWait34() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait35() { @@ -657,7 +657,7 @@ public static void TaskCancelWait35() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait36() { @@ -684,7 +684,7 @@ public static void TaskCancelWait36() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait37() { @@ -701,7 +701,7 @@ public static void TaskCancelWait37() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait38() { @@ -713,7 +713,7 @@ public static void TaskCancelWait38() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait39() { @@ -730,7 +730,7 @@ public static void TaskCancelWait39() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait40() { @@ -754,7 +754,7 @@ public static void TaskCancelWait40() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait41() { @@ -781,7 +781,7 @@ public static void TaskCancelWait41() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait42() { @@ -796,7 +796,7 @@ public static void TaskCancelWait42() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait43() { @@ -819,7 +819,7 @@ public static void TaskCancelWait43() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait44() { @@ -831,7 +831,7 @@ public static void TaskCancelWait44() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait45() { @@ -855,7 +855,7 @@ public static void TaskCancelWait45() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait46() { @@ -870,7 +870,7 @@ public static void TaskCancelWait46() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait47() { @@ -893,7 +893,7 @@ public static void TaskCancelWait47() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait48() { @@ -916,7 +916,7 @@ public static void TaskCancelWait48() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait49() { @@ -928,7 +928,7 @@ public static void TaskCancelWait49() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait50() { @@ -952,7 +952,7 @@ public static void TaskCancelWait50() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait51() { @@ -967,7 +967,7 @@ public static void TaskCancelWait51() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait52() { @@ -994,7 +994,7 @@ public static void TaskCancelWait52() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait53() { @@ -1009,7 +1009,7 @@ public static void TaskCancelWait53() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait54() { @@ -1036,7 +1036,7 @@ public static void TaskCancelWait54() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait55() { @@ -1048,7 +1048,7 @@ public static void TaskCancelWait55() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait56() { @@ -1065,7 +1065,7 @@ public static void TaskCancelWait56() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait57() { @@ -1080,7 +1080,7 @@ public static void TaskCancelWait57() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait58() { @@ -1107,7 +1107,7 @@ public static void TaskCancelWait58() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait59() { @@ -1124,7 +1124,7 @@ public static void TaskCancelWait59() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait60() { @@ -1141,7 +1141,7 @@ public static void TaskCancelWait60() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait61() { @@ -1165,7 +1165,7 @@ public static void TaskCancelWait61() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait62() { @@ -1182,7 +1182,7 @@ public static void TaskCancelWait62() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait63() { @@ -1209,7 +1209,7 @@ public static void TaskCancelWait63() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait64() { @@ -1233,7 +1233,7 @@ public static void TaskCancelWait64() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait65() { @@ -1256,7 +1256,7 @@ public static void TaskCancelWait65() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait66() { @@ -1279,7 +1279,7 @@ public static void TaskCancelWait66() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait67() { @@ -1291,7 +1291,7 @@ public static void TaskCancelWait67() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait68() { @@ -1314,7 +1314,7 @@ public static void TaskCancelWait68() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait69() { @@ -1329,7 +1329,7 @@ public static void TaskCancelWait69() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait70() { @@ -1356,7 +1356,7 @@ public static void TaskCancelWait70() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait71() { @@ -1379,7 +1379,7 @@ public static void TaskCancelWait71() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait72() { @@ -1403,7 +1403,7 @@ public static void TaskCancelWait72() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait73() { @@ -1430,7 +1430,7 @@ public static void TaskCancelWait73() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait74() { @@ -1447,7 +1447,7 @@ public static void TaskCancelWait74() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait75() { @@ -1464,7 +1464,7 @@ public static void TaskCancelWait75() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait76() { @@ -1476,7 +1476,7 @@ public static void TaskCancelWait76() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait77() { @@ -1500,7 +1500,7 @@ public static void TaskCancelWait77() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait78() { @@ -1523,7 +1523,7 @@ public static void TaskCancelWait78() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait79() { @@ -1547,7 +1547,7 @@ public static void TaskCancelWait79() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait80() { @@ -1559,7 +1559,7 @@ public static void TaskCancelWait80() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait81() { @@ -1583,7 +1583,7 @@ public static void TaskCancelWait81() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait82() { @@ -1606,7 +1606,7 @@ public static void TaskCancelWait82() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait83() { @@ -1623,7 +1623,7 @@ public static void TaskCancelWait83() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait84() { @@ -1635,7 +1635,7 @@ public static void TaskCancelWait84() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait85() { @@ -1650,7 +1650,7 @@ public static void TaskCancelWait85() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait86() { @@ -1677,7 +1677,7 @@ public static void TaskCancelWait86() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait87() { @@ -1689,7 +1689,7 @@ public static void TaskCancelWait87() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait88() { @@ -1704,7 +1704,7 @@ public static void TaskCancelWait88() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait89() { @@ -1719,7 +1719,7 @@ public static void TaskCancelWait89() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait90() { @@ -1746,7 +1746,7 @@ public static void TaskCancelWait90() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait91() { @@ -1763,7 +1763,7 @@ public static void TaskCancelWait91() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait92() { @@ -1780,7 +1780,7 @@ public static void TaskCancelWait92() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait93() { @@ -1797,7 +1797,7 @@ public static void TaskCancelWait93() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait94() { @@ -1814,7 +1814,7 @@ public static void TaskCancelWait94() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait95() { @@ -1826,7 +1826,7 @@ public static void TaskCancelWait95() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait96() { @@ -1850,7 +1850,7 @@ public static void TaskCancelWait96() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait97() { @@ -1877,7 +1877,7 @@ public static void TaskCancelWait97() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait98() { @@ -1889,7 +1889,7 @@ public static void TaskCancelWait98() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait99() { @@ -1904,7 +1904,7 @@ public static void TaskCancelWait99() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait100() { @@ -1927,7 +1927,7 @@ public static void TaskCancelWait100() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait101() { @@ -1944,7 +1944,7 @@ public static void TaskCancelWait101() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait102() { @@ -1968,7 +1968,7 @@ public static void TaskCancelWait102() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait103() { @@ -1991,7 +1991,7 @@ public static void TaskCancelWait103() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait104() { @@ -2006,7 +2006,7 @@ public static void TaskCancelWait104() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait105() { @@ -2018,7 +2018,7 @@ public static void TaskCancelWait105() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait106() { @@ -2041,7 +2041,7 @@ public static void TaskCancelWait106() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait107() { @@ -2065,7 +2065,7 @@ public static void TaskCancelWait107() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait108() { @@ -2092,7 +2092,7 @@ public static void TaskCancelWait108() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait109() { @@ -2119,7 +2119,7 @@ public static void TaskCancelWait109() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait110() { @@ -2134,7 +2134,7 @@ public static void TaskCancelWait110() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait111() { @@ -2157,7 +2157,7 @@ public static void TaskCancelWait111() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait112() { @@ -2180,7 +2180,7 @@ public static void TaskCancelWait112() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait113() { @@ -2195,7 +2195,7 @@ public static void TaskCancelWait113() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait114() { @@ -2212,7 +2212,7 @@ public static void TaskCancelWait114() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait115() { @@ -2224,7 +2224,7 @@ public static void TaskCancelWait115() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait116() { @@ -2248,7 +2248,7 @@ public static void TaskCancelWait116() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait117() { @@ -2275,7 +2275,7 @@ public static void TaskCancelWait117() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait118() { @@ -2299,7 +2299,7 @@ public static void TaskCancelWait118() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait119() { @@ -2326,7 +2326,7 @@ public static void TaskCancelWait119() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait120() { @@ -2338,7 +2338,7 @@ public static void TaskCancelWait120() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait121() { @@ -2355,7 +2355,7 @@ public static void TaskCancelWait121() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait122() { @@ -2370,7 +2370,7 @@ public static void TaskCancelWait122() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait123() { @@ -2387,7 +2387,7 @@ public static void TaskCancelWait123() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait124() { @@ -2399,7 +2399,7 @@ public static void TaskCancelWait124() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait125() { @@ -2414,7 +2414,7 @@ public static void TaskCancelWait125() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait126() { @@ -2431,7 +2431,7 @@ public static void TaskCancelWait126() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait127() { @@ -2454,7 +2454,7 @@ public static void TaskCancelWait127() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait128() { @@ -2477,7 +2477,7 @@ public static void TaskCancelWait128() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait129() { @@ -2504,7 +2504,7 @@ public static void TaskCancelWait129() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait130() { @@ -2531,7 +2531,7 @@ public static void TaskCancelWait130() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait131() { @@ -2554,7 +2554,7 @@ public static void TaskCancelWait131() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait132() { @@ -2569,7 +2569,7 @@ public static void TaskCancelWait132() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait133() { @@ -2596,7 +2596,7 @@ public static void TaskCancelWait133() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait134() { @@ -2608,7 +2608,7 @@ public static void TaskCancelWait134() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait135() { @@ -2632,7 +2632,7 @@ public static void TaskCancelWait135() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait136() { @@ -2656,7 +2656,7 @@ public static void TaskCancelWait136() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait137() { @@ -2673,7 +2673,7 @@ public static void TaskCancelWait137() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait138() { @@ -2696,7 +2696,7 @@ public static void TaskCancelWait138() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait139() { @@ -2720,7 +2720,7 @@ public static void TaskCancelWait139() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait140() { @@ -2735,7 +2735,7 @@ public static void TaskCancelWait140() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskCancelWait141() { diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWhenAllTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWhenAllTests.cs index 9f62d5343951ba..24b40dab027490 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWhenAllTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWhenAllTests.cs @@ -15,7 +15,7 @@ public class TaskContinueWhenAllTests #region Test Methods // Test functionality of "bare" ContinueWhenAll overloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestContinueWhenAll_bare() { int smallSize = 2; @@ -146,7 +146,7 @@ public static void TestContinueWhenAll_bare() } // Test functionality of ContinueWhenAll overloads w/ CancellationToken - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestContinueWhenAll_CancellationToken() { int smallSize = 2; @@ -315,7 +315,7 @@ public static void TestContinueWhenAll_CancellationToken() } // Test functionality of ContinueWhenAll overloads w/ TaskContinuationOptions - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestContinueWhenAll_TaskContinuationOptions() { int smallSize = 2; @@ -456,7 +456,7 @@ public static void TestContinueWhenAll_TaskContinuationOptions() } // Test functionality of "full up" ContinueWhenAll overloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestCWAll_CancellationToken_TaskContinuation_TaskScheduler() { int smallSize = 2; @@ -627,7 +627,7 @@ public static void TestCWAll_CancellationToken_TaskContinuation_TaskScheduler() }// end i-loop (antecedents are futures or tasks) } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWhenAllTests_Exceptions() { int smallSize = 2; diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWhenAnyTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWhenAnyTests.cs index dd0df07d1d598a..acf3df08d6d888 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWhenAnyTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWhenAnyTests.cs @@ -10,7 +10,7 @@ public class TaskContinueWhenAnyTests { #region TaskFactory.ContinueWhenAny tests - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWhenAnyTests() { TaskCompletionSource tcs = null; diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithAllAnyTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithAllAnyTests.cs index 8fab167f8dff67..8ef60dd50c8afb 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithAllAnyTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithAllAnyTests.cs @@ -777,7 +777,7 @@ public enum TaskType public sealed class TaskContinueWithAllAnyTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest0() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -788,7 +788,7 @@ public static void TaskContinueWithAllAnyTest0() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest1() { TaskInfo node1 = new TaskInfo(WorkloadType.Exceptional); @@ -801,7 +801,7 @@ public static void TaskContinueWithAllAnyTest1() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest2() { @@ -817,7 +817,7 @@ public static void TaskContinueWithAllAnyTest2() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest3() { @@ -831,7 +831,7 @@ public static void TaskContinueWithAllAnyTest3() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest4() { TaskInfo node1 = new TaskInfo(WorkloadType.Exceptional); @@ -842,7 +842,7 @@ public static void TaskContinueWithAllAnyTest4() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest5() { @@ -856,7 +856,7 @@ public static void TaskContinueWithAllAnyTest5() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest6() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -871,7 +871,7 @@ public static void TaskContinueWithAllAnyTest6() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest7() { @@ -887,7 +887,7 @@ public static void TaskContinueWithAllAnyTest7() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest8() { TaskInfo node1 = new TaskInfo(WorkloadType.Cancelled); @@ -898,7 +898,7 @@ public static void TaskContinueWithAllAnyTest8() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest9() { @@ -912,7 +912,7 @@ public static void TaskContinueWithAllAnyTest9() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest10() { @@ -928,7 +928,7 @@ public static void TaskContinueWithAllAnyTest10() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest11() { @@ -945,7 +945,7 @@ public static void TaskContinueWithAllAnyTest11() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest12() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -955,7 +955,7 @@ public static void TaskContinueWithAllAnyTest12() TaskContinueWithAllAnyTest test = new TaskContinueWithAllAnyTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest13() { TaskInfo node1 = new TaskInfo(WorkloadType.Exceptional); @@ -968,7 +968,7 @@ public static void TaskContinueWithAllAnyTest13() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest14() { @@ -984,7 +984,7 @@ public static void TaskContinueWithAllAnyTest14() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest15() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -996,7 +996,7 @@ public static void TaskContinueWithAllAnyTest15() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest16() { TaskInfo node1 = new TaskInfo(WorkloadType.Exceptional); @@ -1008,7 +1008,7 @@ public static void TaskContinueWithAllAnyTest16() } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest17() { @@ -1022,7 +1022,7 @@ public static void TaskContinueWithAllAnyTest17() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest18() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -1037,7 +1037,7 @@ public static void TaskContinueWithAllAnyTest18() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest19() { TaskInfo node1 = new TaskInfo(WorkloadType.VeryLight); @@ -1050,7 +1050,7 @@ public static void TaskContinueWithAllAnyTest19() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest20() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -1061,7 +1061,7 @@ public static void TaskContinueWithAllAnyTest20() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest21() { TaskInfo node1 = new TaskInfo(WorkloadType.Cancelled); @@ -1072,7 +1072,7 @@ public static void TaskContinueWithAllAnyTest21() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest22() { @@ -1086,7 +1086,7 @@ public static void TaskContinueWithAllAnyTest22() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest23() { TaskInfo node1 = new TaskInfo(WorkloadType.VeryLight); @@ -1099,7 +1099,7 @@ public static void TaskContinueWithAllAnyTest23() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest24() { @@ -1115,7 +1115,7 @@ public static void TaskContinueWithAllAnyTest24() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest25() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -1126,7 +1126,7 @@ public static void TaskContinueWithAllAnyTest25() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest26() { @@ -1147,7 +1147,7 @@ public static void TaskContinueWithAllAnyTest26() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest27() { TaskInfo node1 = new TaskInfo(WorkloadType.Exceptional); @@ -1164,7 +1164,7 @@ public static void TaskContinueWithAllAnyTest27() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest28() { @@ -1185,7 +1185,7 @@ public static void TaskContinueWithAllAnyTest28() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest29() { @@ -1206,7 +1206,7 @@ public static void TaskContinueWithAllAnyTest29() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest30() { @@ -1226,7 +1226,7 @@ public static void TaskContinueWithAllAnyTest30() TaskContinueWithAllAnyTest test = new TaskContinueWithAllAnyTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest31() { TaskInfo node1 = new TaskInfo(WorkloadType.Exceptional); @@ -1238,7 +1238,7 @@ public static void TaskContinueWithAllAnyTest31() TaskContinueWithAllAnyTest test = new TaskContinueWithAllAnyTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest32() { TaskInfo node1 = new TaskInfo(WorkloadType.Exceptional); @@ -1250,7 +1250,7 @@ public static void TaskContinueWithAllAnyTest32() TaskContinueWithAllAnyTest test = new TaskContinueWithAllAnyTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest33() { TaskInfo node1 = new TaskInfo(WorkloadType.Exceptional); @@ -1262,7 +1262,7 @@ public static void TaskContinueWithAllAnyTest33() TaskContinueWithAllAnyTest test = new TaskContinueWithAllAnyTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest34() { TaskInfo node1 = new TaskInfo(WorkloadType.Cancelled); @@ -1273,7 +1273,7 @@ public static void TaskContinueWithAllAnyTest34() TaskContinueWithAllAnyTest test = new TaskContinueWithAllAnyTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest35() { TaskInfo node1 = new TaskInfo(WorkloadType.Exceptional); @@ -1284,7 +1284,7 @@ public static void TaskContinueWithAllAnyTest35() TaskContinueWithAllAnyTest test = new TaskContinueWithAllAnyTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest36() { TaskInfo node1 = new TaskInfo(WorkloadType.Exceptional); @@ -1297,7 +1297,7 @@ public static void TaskContinueWithAllAnyTest36() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskContinueWithAllAnyTest37() { TaskInfo node1 = new TaskInfo(WorkloadType.Exceptional); @@ -1310,7 +1310,7 @@ public static void TaskContinueWithAllAnyTest37() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest38() { @@ -1323,7 +1323,7 @@ public static void TaskContinueWithAllAnyTest38() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskContinueWithAllAnyTest39() { diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithTests.cs index 2800a5e9e24c46..8a1ccb87eeba0a 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWithTests.cs @@ -17,7 +17,7 @@ public static class TaskContinueWithTests { #region ContinueWith Tests - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithAsyncStateCheckTests() { Task t = new Task(() => { }); @@ -72,7 +72,7 @@ public static void RunContinueWithStressTestsNoState() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithPreCancelTests() { Action EnsureCompletionStatus = delegate (Task task, bool shouldBeCompleted, string message) @@ -131,7 +131,7 @@ public static void RunContinueWithPreCancelTests() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinuationChainingTest() { int x = 0; @@ -173,7 +173,7 @@ public static void RunContinuationChainingTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithParamsTest_Cancellation() { // @@ -256,7 +256,7 @@ public static void RunContinueWithParamsTest_IllegalArgs() } // Test what happens when you cancel a task in the middle of a continuation chain. - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(false)] [InlineData(true)] public static void RunContinuationCancelTest(bool useTimeSpan) @@ -306,7 +306,7 @@ public static void RunContinuationCancelTest(bool useTimeSpan) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithExceptionTestsNoState() { // @@ -357,7 +357,7 @@ public static void RunContinueWithExceptionTestsNoState() () => { f1.ContinueWith(_ => 5, CancellationToken.None, TaskContinuationOptions.None, (TaskScheduler)null); }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithAllParamsTestsNoState() { for (int i = 0; i < 2; i++) @@ -613,7 +613,7 @@ public static void RunContinueWithAllParamsTestsNoState() } // Make sure that cancellation works for monadic versions of ContinueWith() - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunUnwrapTests() { Task taskRoot = null; @@ -784,7 +784,7 @@ public static void RunUnwrapTests() //catch (Exception e) { } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunUnwrapTests_ExceptionTests() { Task taskRoot = null; @@ -1035,7 +1035,7 @@ public static void RunUnwrapTests_CancellationTests() } // Test what happens when you cancel a task in the middle of a continuation chain. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinuationCancelTest_State() { bool t1Ran = false; @@ -1075,7 +1075,7 @@ public static void RunContinuationCancelTest_State() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestNoDeadlockOnContinueWith() { Debug.WriteLine("TestNoDeadlockOnContinueWith: shouldn't deadlock if it passes."); @@ -1092,7 +1092,7 @@ public static void TestNoDeadlockOnContinueWith() Debug.WriteLine("Success!"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunLazyCancellationTests() { for (int i = 0; i < 2; i++) @@ -1148,7 +1148,7 @@ public static void RunLazyCancellationTests() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunLazyCancellationTests_Negative() { for (int i = 0; i < 2; i++) @@ -1238,7 +1238,8 @@ public static void LongContinuationChain_ContinueWith_DoesNotStackOverflow() t.Wait(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] + [SkipOnPlatform(TestPlatforms.Browser, "Causes a stack overflow")] public static void LongContinuationChain_Unwrap_DoesNotStackOverflow() { const int DiveDepth = 12_000; @@ -1254,7 +1255,8 @@ public static void LongContinuationChain_Unwrap_DoesNotStackOverflow() func(DiveDepth).Wait(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] + [SkipOnPlatform(TestPlatforms.Browser, "Causes a stack overflow")] public static void LongContinuationChain_Await_DoesNotStackOverflow() { const int DiveDepth = 12_000; @@ -1269,7 +1271,7 @@ await await Task.Factory.StartNew(() => func(count), CancellationToken.None, Tas func(0).Wait(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(false)] [InlineData(true)] public static void TestNoDeadlockOnContinueWithExecuteSynchronously(bool useWaitAll) diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWith_ContFuncAndActionTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWith_ContFuncAndActionTests.cs index 37a7738b23154b..16176cc57a3d8d 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWith_ContFuncAndActionTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWith_ContFuncAndActionTests.cs @@ -21,7 +21,7 @@ public class TaskContinueWith_ContFuncAndActionTests #region Test Methods - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTestsNoState_NoneCompleted() { RunContinueWithTaskTask(TaskContinuationOptions.None); @@ -31,7 +31,7 @@ public static void RunContinueWithTestsNoState_NoneCompleted() RunContinueWithTaskTask(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTaskFuture_NoneCompleted() { RunContinueWithTaskFuture(TaskContinuationOptions.None); @@ -41,7 +41,7 @@ public static void RunContinueWithTaskFuture_NoneCompleted() RunContinueWithTaskFuture(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureTask_NoneCompleted() { RunContinueWithFutureTask(TaskContinuationOptions.None); @@ -51,7 +51,7 @@ public static void RunContinueWithFutureTask_NoneCompleted() RunContinueWithFutureTask(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureFuture_NoneCompleted() { RunContinueWithFutureFuture(TaskContinuationOptions.None); @@ -61,7 +61,7 @@ public static void RunContinueWithFutureFuture_NoneCompleted() RunContinueWithFutureFuture(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTestsNoState_FaultedCanceled() { RunContinueWithTaskTask(s_onlyOnCanceled); @@ -71,7 +71,7 @@ public static void RunContinueWithTestsNoState_FaultedCanceled() RunContinueWithTaskTask(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTaskFuture_FaultedCanceled() { RunContinueWithTaskFuture(s_onlyOnCanceled); @@ -81,7 +81,7 @@ public static void RunContinueWithTaskFuture_FaultedCanceled() RunContinueWithTaskFuture(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureTask_FaultedCanceled() { RunContinueWithFutureTask(s_onlyOnCanceled); @@ -91,7 +91,7 @@ public static void RunContinueWithFutureTask_FaultedCanceled() RunContinueWithFutureTask(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureFuture_FaultedCanceled() { RunContinueWithFutureFuture(s_onlyOnCanceled); @@ -102,7 +102,7 @@ public static void RunContinueWithFutureFuture_FaultedCanceled() } // Exception tests. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTestsNoState_NoneCompleted_OnException() { RunContinueWithTaskTask(TaskContinuationOptions.None, true); @@ -112,7 +112,7 @@ public static void RunContinueWithTestsNoState_NoneCompleted_OnException() RunContinueWithTaskTask(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTaskFuture_NoneCompleted_OnException() { RunContinueWithTaskFuture(TaskContinuationOptions.None, true); @@ -122,7 +122,7 @@ public static void RunContinueWithTaskFuture_NoneCompleted_OnException() RunContinueWithTaskFuture(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureTask_NoneCompleted_OnException() { RunContinueWithFutureTask(TaskContinuationOptions.None, true); @@ -132,7 +132,7 @@ public static void RunContinueWithFutureTask_NoneCompleted_OnException() RunContinueWithFutureTask(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureFuture_NoneCompleted_OnException() { RunContinueWithFutureFuture(TaskContinuationOptions.None, true); @@ -142,7 +142,7 @@ public static void RunContinueWithFutureFuture_NoneCompleted_OnException() RunContinueWithFutureFuture(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTestsNoState_FaultedCanceled_OnException() { RunContinueWithTaskTask(s_onlyOnCanceled, true); @@ -151,7 +151,7 @@ public static void RunContinueWithTestsNoState_FaultedCanceled_OnException() RunContinueWithTaskTask(s_onlyOnCanceled | TaskContinuationOptions.ExecuteSynchronously, true); RunContinueWithTaskTask(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTaskFuture_FaultedCanceled_OnException() { RunContinueWithTaskFuture(s_onlyOnCanceled, true); @@ -161,7 +161,7 @@ public static void RunContinueWithTaskFuture_FaultedCanceled_OnException() RunContinueWithTaskFuture(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureTask_FaultedCanceled_OnException() { RunContinueWithFutureTask(s_onlyOnCanceled, true); @@ -171,7 +171,7 @@ public static void RunContinueWithFutureTask_FaultedCanceled_OnException() RunContinueWithFutureTask(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureFuture_FaultedCanceled_OnException() { RunContinueWithFutureFuture(s_onlyOnCanceled, true); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWith_ContFuncAndActionWithArgsTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWith_ContFuncAndActionWithArgsTests.cs index 00c34e5727ebd3..80c60f7ca22724 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWith_ContFuncAndActionWithArgsTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskContinueWith_ContFuncAndActionWithArgsTests.cs @@ -21,7 +21,7 @@ public class TaskContinueWith_ContFuncAndActionWithArgsTests #region Test Methods - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTaskTask_State() { RunContinueWithTaskTask_State_Helper(TaskContinuationOptions.None); @@ -31,7 +31,7 @@ public static void RunContinueWithTaskTask_State() RunContinueWithTaskTask_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTaskFuture_State() { RunContinueWithTaskFuture_State_Helper(TaskContinuationOptions.None); @@ -41,7 +41,7 @@ public static void RunContinueWithTaskFuture_State() RunContinueWithTaskFuture_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureTask_State() { RunContinueWithFutureTask_State_Helper(TaskContinuationOptions.None); @@ -51,7 +51,7 @@ public static void RunContinueWithFutureTask_State() RunContinueWithFutureTask_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureFuture_State() { RunContinueWithFutureFuture_State_Helper(TaskContinuationOptions.None); @@ -61,7 +61,7 @@ public static void RunContinueWithFutureFuture_State() RunContinueWithFutureFuture_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTaskTask_State_FaultedCanceled() { RunContinueWithTaskTask_State_Helper(s_onlyOnCanceled); @@ -71,7 +71,7 @@ public static void RunContinueWithTaskTask_State_FaultedCanceled() RunContinueWithTaskTask_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTaskFuture_State_FaultedCanceled() { RunContinueWithTaskFuture_State_Helper(s_onlyOnCanceled); @@ -81,7 +81,7 @@ public static void RunContinueWithTaskFuture_State_FaultedCanceled() RunContinueWithTaskFuture_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureTask_State_FaultedCanceled() { RunContinueWithFutureTask_State_Helper(s_onlyOnCanceled); @@ -91,7 +91,7 @@ public static void RunContinueWithFutureTask_State_FaultedCanceled() RunContinueWithFutureTask_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureFuture_State_FaultedCanceled() { RunContinueWithFutureFuture_State_Helper(s_onlyOnCanceled); @@ -101,7 +101,7 @@ public static void RunContinueWithFutureFuture_State_FaultedCanceled() RunContinueWithFutureFuture_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTaskTask_State_OnException() { RunContinueWithTaskTask_State_Helper(TaskContinuationOptions.None, true); @@ -111,7 +111,7 @@ public static void RunContinueWithTaskTask_State_OnException() RunContinueWithTaskTask_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTaskFuture_State_OnException() { RunContinueWithTaskFuture_State_Helper(TaskContinuationOptions.None, true); @@ -121,7 +121,7 @@ public static void RunContinueWithTaskFuture_State_OnException() RunContinueWithTaskFuture_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureTask_State_OnException() { RunContinueWithFutureTask_State_Helper(TaskContinuationOptions.None, true); @@ -131,7 +131,7 @@ public static void RunContinueWithFutureTask_State_OnException() RunContinueWithFutureTask_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureFuture_State_OnException() { RunContinueWithFutureFuture_State_Helper(TaskContinuationOptions.None, true); @@ -141,7 +141,7 @@ public static void RunContinueWithFutureFuture_State_OnException() RunContinueWithFutureFuture_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTaskTask_State_FaultedCanceled_OnException() { RunContinueWithTaskTask_State_Helper(s_onlyOnCanceled, true); @@ -151,7 +151,7 @@ public static void RunContinueWithTaskTask_State_FaultedCanceled_OnException() RunContinueWithTaskTask_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithTaskFuture_State_FaultedCanceled_OnException() { RunContinueWithTaskFuture_State_Helper(s_onlyOnCanceled, true); @@ -161,7 +161,7 @@ public static void RunContinueWithTaskFuture_State_FaultedCanceled_OnException() RunContinueWithTaskFuture_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureTask_State_FaultedCanceled_OnException() { RunContinueWithFutureTask_State_Helper(s_onlyOnCanceled, true); @@ -171,7 +171,7 @@ public static void RunContinueWithFutureTask_State_FaultedCanceled_OnException() RunContinueWithFutureTask_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithFutureFuture_State_FaultedCanceled_OnException() { RunContinueWithFutureFuture_State_Helper(s_onlyOnCanceled, true); @@ -181,7 +181,7 @@ public static void RunContinueWithFutureFuture_State_FaultedCanceled_OnException RunContinueWithFutureFuture_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithPreCancelTests_State() { Action EnsureCompletionStatus = delegate (Task task, bool shouldBeCompleted, string message) @@ -261,7 +261,7 @@ public static void RunContinueWithPreCancelTests_State() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinuationChainingTest_State() { int x = 0; @@ -304,7 +304,7 @@ public static void RunContinuationChainingTest_State() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithOnDisposedTaskTest_State() { Task t1 = Task.Factory.StartNew(delegate { }); @@ -322,7 +322,7 @@ public static void RunContinueWithOnDisposedTaskTest_State() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithParamsTest_State_Cancellation() { string stateParam = "test"; //used as a state parameter for the continuation if the useStateParam is true @@ -372,7 +372,7 @@ public static void RunContinueWithParamsTest_State_Cancellation() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunContinueWithParamsTest_State_IllegalParameters() { Task t1 = new Task(delegate { }); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskCreateTest.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskCreateTest.cs index dc978a88d9c01e..4edf737c34b3de 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskCreateTest.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskCreateTest.cs @@ -20,7 +20,7 @@ public sealed class TaskCreateTests { #region Test Methods - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest0() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -35,7 +35,7 @@ public static void TaskCreateTest0() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest1() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -50,7 +50,7 @@ public static void TaskCreateTest1() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest2() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -65,7 +65,7 @@ public static void TaskCreateTest2() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest3() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -80,7 +80,7 @@ public static void TaskCreateTest3() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest4() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -94,7 +94,7 @@ public static void TaskCreateTest4() TaskCreateTest test = new TaskCreateTest(parameters); test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest5() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -108,7 +108,7 @@ public static void TaskCreateTest5() TaskCreateTest test = new TaskCreateTest(parameters); test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest6() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -122,7 +122,7 @@ public static void TaskCreateTest6() TaskCreateTest test = new TaskCreateTest(parameters); test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest7() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -137,7 +137,7 @@ public static void TaskCreateTest7() test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest8() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -152,7 +152,7 @@ public static void TaskCreateTest8() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest9() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -167,7 +167,7 @@ public static void TaskCreateTest9() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest10() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -182,7 +182,7 @@ public static void TaskCreateTest10() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest11() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -197,7 +197,7 @@ public static void TaskCreateTest11() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest12() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -212,7 +212,7 @@ public static void TaskCreateTest12() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest13() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -227,7 +227,7 @@ public static void TaskCreateTest13() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest14() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -242,7 +242,7 @@ public static void TaskCreateTest14() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest15() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -257,7 +257,7 @@ public static void TaskCreateTest15() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest16() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -272,7 +272,7 @@ public static void TaskCreateTest16() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest17() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -287,7 +287,7 @@ public static void TaskCreateTest17() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest18() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -302,7 +302,7 @@ public static void TaskCreateTest18() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest19() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -317,7 +317,7 @@ public static void TaskCreateTest19() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest20() { TestParameters parameters = new TestParameters(TaskType.FutureT) @@ -331,7 +331,7 @@ public static void TaskCreateTest20() TaskCreateTest test = new TaskCreateTest(parameters); test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest21() { TestParameters parameters = new TestParameters(TaskType.Future) @@ -345,7 +345,7 @@ public static void TaskCreateTest21() TaskCreateTest test = new TaskCreateTest(parameters); test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest22() { TestParameters parameters = new TestParameters(TaskType.Future) @@ -359,7 +359,7 @@ public static void TaskCreateTest22() TaskCreateTest test = new TaskCreateTest(parameters); test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest23() { TestParameters parameters = new TestParameters(TaskType.Future) @@ -374,7 +374,7 @@ public static void TaskCreateTest23() test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest24() { TestParameters parameters = new TestParameters(TaskType.Future) @@ -389,7 +389,7 @@ public static void TaskCreateTest24() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest25() { TestParameters parameters = new TestParameters(TaskType.Future) @@ -404,7 +404,7 @@ public static void TaskCreateTest25() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest26() { TestParameters parameters = new TestParameters(TaskType.Future) @@ -419,7 +419,7 @@ public static void TaskCreateTest26() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest27() { TestParameters parameters = new TestParameters(TaskType.Future) @@ -434,7 +434,7 @@ public static void TaskCreateTest27() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest28() { TestParameters parameters = new TestParameters(TaskType.Future) @@ -449,7 +449,7 @@ public static void TaskCreateTest28() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest29() { TestParameters parameters = new TestParameters(TaskType.Future) @@ -464,7 +464,7 @@ public static void TaskCreateTest29() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest30() { TestParameters parameters = new TestParameters(TaskType.Promise) @@ -479,7 +479,7 @@ public static void TaskCreateTest30() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest31() { TestParameters parameters = new TestParameters(TaskType.Promise) @@ -494,7 +494,7 @@ public static void TaskCreateTest31() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest32() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -509,7 +509,7 @@ public static void TaskCreateTest32() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest33() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -524,7 +524,7 @@ public static void TaskCreateTest33() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest34() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -539,7 +539,7 @@ public static void TaskCreateTest34() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest35() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -554,7 +554,7 @@ public static void TaskCreateTest35() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest36() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -568,7 +568,7 @@ public static void TaskCreateTest36() TaskCreateTest test = new TaskCreateTest(parameters); test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest37() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -582,7 +582,7 @@ public static void TaskCreateTest37() TaskCreateTest test = new TaskCreateTest(parameters); test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest38() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -596,7 +596,7 @@ public static void TaskCreateTest38() TaskCreateTest test = new TaskCreateTest(parameters); test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest39() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -610,7 +610,7 @@ public static void TaskCreateTest39() TaskCreateTest test = new TaskCreateTest(parameters); test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest40() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -624,7 +624,7 @@ public static void TaskCreateTest40() TaskCreateTest test = new TaskCreateTest(parameters); test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest41() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -638,7 +638,7 @@ public static void TaskCreateTest41() TaskCreateTest test = new TaskCreateTest(parameters); test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest42() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -653,7 +653,7 @@ public static void TaskCreateTest42() test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest43() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -668,7 +668,7 @@ public static void TaskCreateTest43() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest44() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -683,7 +683,7 @@ public static void TaskCreateTest44() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest45() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -698,7 +698,7 @@ public static void TaskCreateTest45() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest46() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -713,7 +713,7 @@ public static void TaskCreateTest46() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest47() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -728,7 +728,7 @@ public static void TaskCreateTest47() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest48() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -743,7 +743,7 @@ public static void TaskCreateTest48() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest49() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -758,7 +758,7 @@ public static void TaskCreateTest49() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest50() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -773,7 +773,7 @@ public static void TaskCreateTest50() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest51() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -788,7 +788,7 @@ public static void TaskCreateTest51() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest52() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -803,7 +803,7 @@ public static void TaskCreateTest52() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest53() { TestParameters parameters = new TestParameters(TaskType.Task) @@ -818,7 +818,7 @@ public static void TaskCreateTest53() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskCreateTest54() { TestParameters parameters = new TestParameters(TaskType.Task) diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskFromAsyncTest2.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskFromAsyncTest2.cs index 08bdca617a2086..ed7ed0207d8299 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskFromAsyncTest2.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskFromAsyncTest2.cs @@ -22,7 +22,7 @@ public partial class TaskFromAsyncTests { #region Test Methods - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest0() { TestParameters parameters = new TestParameters(API.APM, TaskType.TaskT, TaskType.TaskT, OverloadChoice.None, ErrorCase.None); @@ -30,7 +30,7 @@ public static void TaskFromAsyncTest0() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest3() { TestParameters parameters = new TestParameters(API.APM, TaskType.TaskT, TaskType.TaskT, OverloadChoice.None, ErrorCase.Throwing); @@ -38,7 +38,7 @@ public static void TaskFromAsyncTest3() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest4() { TestParameters parameters = new TestParameters(API.APM_T2, TaskType.TaskT, TaskType.TaskT, OverloadChoice.None, ErrorCase.None); @@ -46,7 +46,7 @@ public static void TaskFromAsyncTest4() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest7() { TestParameters parameters = new TestParameters(API.APM_T2, TaskType.TaskT, TaskType.TaskT, OverloadChoice.None, ErrorCase.Throwing); @@ -54,7 +54,7 @@ public static void TaskFromAsyncTest7() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest8() { TestParameters parameters = new TestParameters(API.APM_T2, TaskType.TaskT, TaskType.TaskT, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -62,7 +62,7 @@ public static void TaskFromAsyncTest8() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest9() { TestParameters parameters = new TestParameters(API.APM_T3, TaskType.TaskT, TaskType.TaskT, OverloadChoice.None, ErrorCase.None); @@ -70,7 +70,7 @@ public static void TaskFromAsyncTest9() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest12() { TestParameters parameters = new TestParameters(API.APM_T3, TaskType.TaskT, TaskType.TaskT, OverloadChoice.None, ErrorCase.Throwing); @@ -78,7 +78,7 @@ public static void TaskFromAsyncTest12() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest13() { TestParameters parameters = new TestParameters(API.APM_T3, TaskType.TaskT, TaskType.TaskT, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -86,7 +86,7 @@ public static void TaskFromAsyncTest13() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest14() { TestParameters parameters = new TestParameters(API.APM_T, TaskType.TaskT, TaskType.TaskT, OverloadChoice.None, ErrorCase.None); @@ -94,7 +94,7 @@ public static void TaskFromAsyncTest14() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest17() { TestParameters parameters = new TestParameters(API.APM_T, TaskType.TaskT, TaskType.TaskT, OverloadChoice.None, ErrorCase.Throwing); @@ -102,7 +102,7 @@ public static void TaskFromAsyncTest17() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest18() { TestParameters parameters = new TestParameters(API.APM_T, TaskType.TaskT, TaskType.TaskT, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -110,7 +110,7 @@ public static void TaskFromAsyncTest18() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest19() { TestParameters parameters = new TestParameters(API.APM, TaskType.TaskT, TaskType.TaskT, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -118,7 +118,7 @@ public static void TaskFromAsyncTest19() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest20() { TestParameters parameters = new TestParameters(API.IAsyncResult, TaskType.TaskT, TaskType.TaskT, OverloadChoice.None, ErrorCase.None); @@ -126,14 +126,14 @@ public static void TaskFromAsyncTest20() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest22() { TestParameters parameters = new TestParameters(API.IAsyncResult, TaskType.TaskT, TaskType.TaskT, OverloadChoice.None, ErrorCase.NullEnd); TaskFromAsyncTest test = new TaskFromAsyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest23() { TestParameters parameters = new TestParameters(API.IAsyncResult, TaskType.TaskT, TaskType.TaskT, OverloadChoice.None, ErrorCase.Throwing); @@ -141,7 +141,7 @@ public static void TaskFromAsyncTest23() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest25() { TestParameters parameters = new TestParameters(API.IAsyncResult, TaskType.TaskT, TaskType.TaskT, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -149,7 +149,7 @@ public static void TaskFromAsyncTest25() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest27() { TestParameters parameters = new TestParameters(API.APM, TaskType.Task, TaskType.TaskT, OverloadChoice.None, ErrorCase.None); @@ -158,35 +158,35 @@ public static void TaskFromAsyncTest27() } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest30() { TestParameters parameters = new TestParameters(API.APM, TaskType.Task, TaskType.TaskT, OverloadChoice.None, ErrorCase.Throwing); TaskFromAsyncTest test = new TaskFromAsyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest33() { TestParameters parameters = new TestParameters(API.APM_T2, TaskType.Task, TaskType.TaskT, OverloadChoice.None, ErrorCase.Throwing); TaskFromAsyncTest test = new TaskFromAsyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest34() { TestParameters parameters = new TestParameters(API.APM_T2, TaskType.Task, TaskType.TaskT, OverloadChoice.WithTaskOption, ErrorCase.None); TaskFromAsyncTest test = new TaskFromAsyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest35() { TestParameters parameters = new TestParameters(API.APM_T3, TaskType.Task, TaskType.TaskT, OverloadChoice.None, ErrorCase.None); TaskFromAsyncTest test = new TaskFromAsyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest38() { TestParameters parameters = new TestParameters(API.APM_T3, TaskType.Task, TaskType.TaskT, OverloadChoice.None, ErrorCase.Throwing); @@ -194,7 +194,7 @@ public static void TaskFromAsyncTest38() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest39() { TestParameters parameters = new TestParameters(API.APM_T3, TaskType.Task, TaskType.TaskT, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -202,14 +202,14 @@ public static void TaskFromAsyncTest39() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest40() { TestParameters parameters = new TestParameters(API.APM_T, TaskType.Task, TaskType.TaskT, OverloadChoice.None, ErrorCase.None); TaskFromAsyncTest test = new TaskFromAsyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest43() { TestParameters parameters = new TestParameters(API.APM_T, TaskType.Task, TaskType.TaskT, OverloadChoice.None, ErrorCase.Throwing); @@ -217,7 +217,7 @@ public static void TaskFromAsyncTest43() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest44() { TestParameters parameters = new TestParameters(API.APM_T, TaskType.Task, TaskType.TaskT, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -225,7 +225,7 @@ public static void TaskFromAsyncTest44() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest45() { TestParameters parameters = new TestParameters(API.APM, TaskType.Task, TaskType.TaskT, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -234,14 +234,14 @@ public static void TaskFromAsyncTest45() } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest47() { TestParameters parameters = new TestParameters(API.IAsyncResult, TaskType.Task, TaskType.TaskT, OverloadChoice.None, ErrorCase.NullEnd); TaskFromAsyncTest test = new TaskFromAsyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest48() { TestParameters parameters = new TestParameters(API.IAsyncResult, TaskType.Task, TaskType.TaskT, OverloadChoice.None, ErrorCase.Throwing); @@ -249,7 +249,7 @@ public static void TaskFromAsyncTest48() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest50() { TestParameters parameters = new TestParameters(API.IAsyncResult, TaskType.Task, TaskType.TaskT, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -257,14 +257,14 @@ public static void TaskFromAsyncTest50() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest52() { TestParameters parameters = new TestParameters(API.APM, TaskType.Task, TaskType.Task, OverloadChoice.None, ErrorCase.None); TaskFromAsyncTest test = new TaskFromAsyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest55() { TestParameters parameters = new TestParameters(API.APM, TaskType.Task, TaskType.Task, OverloadChoice.None, ErrorCase.Throwing); @@ -272,7 +272,7 @@ public static void TaskFromAsyncTest55() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest56() { TestParameters parameters = new TestParameters(API.APM_T2, TaskType.Task, TaskType.Task, OverloadChoice.None, ErrorCase.None); @@ -281,7 +281,7 @@ public static void TaskFromAsyncTest56() } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest59() { TestParameters parameters = new TestParameters(API.APM_T2, TaskType.Task, TaskType.Task, OverloadChoice.None, ErrorCase.Throwing); @@ -289,7 +289,7 @@ public static void TaskFromAsyncTest59() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest60() { TestParameters parameters = new TestParameters(API.APM_T2, TaskType.Task, TaskType.Task, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -297,7 +297,7 @@ public static void TaskFromAsyncTest60() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest61() { TestParameters parameters = new TestParameters(API.APM_T3, TaskType.Task, TaskType.Task, OverloadChoice.None, ErrorCase.None); @@ -306,7 +306,7 @@ public static void TaskFromAsyncTest61() } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest64() { TestParameters parameters = new TestParameters(API.APM_T3, TaskType.Task, TaskType.Task, OverloadChoice.None, ErrorCase.Throwing); @@ -314,7 +314,7 @@ public static void TaskFromAsyncTest64() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest65() { TestParameters parameters = new TestParameters(API.APM_T3, TaskType.Task, TaskType.Task, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -322,7 +322,7 @@ public static void TaskFromAsyncTest65() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest66() { TestParameters parameters = new TestParameters(API.APM_T, TaskType.Task, TaskType.Task, OverloadChoice.None, ErrorCase.None); @@ -331,7 +331,7 @@ public static void TaskFromAsyncTest66() } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest69() { TestParameters parameters = new TestParameters(API.APM_T, TaskType.Task, TaskType.Task, OverloadChoice.None, ErrorCase.Throwing); @@ -339,7 +339,7 @@ public static void TaskFromAsyncTest69() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest70() { TestParameters parameters = new TestParameters(API.APM_T, TaskType.Task, TaskType.Task, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -347,7 +347,7 @@ public static void TaskFromAsyncTest70() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest71() { TestParameters parameters = new TestParameters(API.APM, TaskType.Task, TaskType.Task, OverloadChoice.WithTaskOption, ErrorCase.None); @@ -355,7 +355,7 @@ public static void TaskFromAsyncTest71() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest72() { TestParameters parameters = new TestParameters(API.IAsyncResult, TaskType.Task, TaskType.Task, OverloadChoice.None, ErrorCase.None); @@ -364,14 +364,14 @@ public static void TaskFromAsyncTest72() } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest74() { TestParameters parameters = new TestParameters(API.IAsyncResult, TaskType.Task, TaskType.Task, OverloadChoice.None, ErrorCase.NullEnd); TaskFromAsyncTest test = new TaskFromAsyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest75() { TestParameters parameters = new TestParameters(API.IAsyncResult, TaskType.Task, TaskType.Task, OverloadChoice.None, ErrorCase.Throwing); @@ -379,7 +379,7 @@ public static void TaskFromAsyncTest75() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskFromAsyncTest77() { TestParameters parameters = new TestParameters(API.IAsyncResult, TaskType.Task, TaskType.Task, OverloadChoice.WithTaskOption, ErrorCase.None); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskPropertiesTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskPropertiesTests.cs index 515b7ee2896242..7e2b4e8b874979 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskPropertiesTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskPropertiesTests.cs @@ -21,7 +21,7 @@ public sealed class TaskPropertiesTests /// /// Test to ensure that the task and task scheduler IDs are unique when tasks are started /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskIDTest() { // Read Parameters diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskRtTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskRtTests.cs index 759502f6ba8567..23a8d51af295f2 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskRtTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskRtTests.cs @@ -12,7 +12,7 @@ namespace System.Threading.Tasks.Tests { public static class TaskRtTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void RunRunTests() { @@ -128,7 +128,7 @@ public static void RunRunTests() Assert.True(future2.Status == TaskStatus.RanToCompletion, " > FAILED. Future(unwrapped) w/ uncanceled token did not end in RanToCompletion state."); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void RunRunTests_Cancellation_Negative() { @@ -168,7 +168,7 @@ public static void RunRunTests_Cancellation_Negative() Assert.True(future3.IsCanceled, " > FAILED. Future(unwrapped) w/ canceled token should have ended in Canceled state"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunRunTests_FastPathTests() { CancellationTokenSource cts = new CancellationTokenSource(); @@ -254,7 +254,7 @@ public static void RunRunTests_FastPathTests() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunRunTests_Unwrap_NegativeCases() { // @@ -617,7 +617,7 @@ public static void RunDelayTests() Assert.False(task7.IsCompleted, "RunDelayTests: > FAILED. Delay(10000) appears to have completed too soon(2)."); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunDelayTests_NegativeCases() { CancellationTokenSource disposedCTS = new CancellationTokenSource(); @@ -682,7 +682,7 @@ public static void RunDelayTests_NegativeCases() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskDelay_Cancellation_ContinuationsInvokedAsynchronously() { var cts = new CancellationTokenSource(); @@ -702,7 +702,7 @@ public static void TaskDelay_Cancellation_ContinuationsInvokedAsynchronously() // Test that exceptions are properly wrapped when thrown in various scenarios. // Make sure that "indirect" logic does not add superfluous exception wrapping. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunExceptionWrappingTest() { Action throwException = delegate { throw new InvalidOperationException(); }; @@ -850,7 +850,7 @@ public static void RunExceptionWrappingTest() AsyncExceptionChecker(asyncFuture, "Future-based FromAsync(beginMethod, ...)"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunHideSchedulerTests() { TaskScheduler[] schedules = new TaskScheduler[2]; @@ -920,7 +920,7 @@ public static void RunHideSchedulerTests_Negative() () => { new TaskCompletionSource(TaskCreationOptions.HideScheduler); }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunDenyChildAttachTests() { // StartNew, Task and Future diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskRtTests_Core.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskRtTests_Core.cs index 088c45ddc116fc..bd911f73bd3467 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskRtTests_Core.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskRtTests_Core.cs @@ -14,7 +14,7 @@ namespace System.Threading.Tasks.Tests { public static class TaskRtTests_Core { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTCSCompletionStateTests() { TaskCompletionSource tcs = null; @@ -70,7 +70,7 @@ public static void RunTCSCompletionStateTests() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTCSCompletionStateTests_SetCancel() { // Testing competing SetCancels @@ -124,7 +124,7 @@ public static void RunTCSCompletionStateTests_SetCancel() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTCSCompletionStateTests_SetException() { TaskCompletionSource tcs = null; @@ -481,7 +481,7 @@ public static void RunTaskCreateTests() } // Test "bare" overloads for Task ctor, Task.Factory.StartNew - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestTaskTConstruction_bare() { for (int i = 0; i < 2; i++) @@ -543,7 +543,7 @@ public static void TestTaskTConstruction_bare() } // Test overloads for Task ctor, Task.Factory.StartNew that accept a CancellationToken - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestTaskTConstruction_ct() { for (int i = 0; i < 2; i++) @@ -625,7 +625,7 @@ public static void TestTaskTConstruction_ct() } // Test overloads for Task ctor, Task.Factory.StartNew that accept a TaskCreationOptions param - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestTaskTConstruction_tco() { for (int i = 0; i < 2; i++) @@ -689,7 +689,7 @@ public static void TestTaskTConstruction_tco() } // Test overloads for Task ctor, Task.Factory.StartNew that accept a CancellationToken and TaskCreationOptions - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestTaskTConstruction_ct_tco() { for (int i = 0; i < 2; i++) @@ -829,7 +829,7 @@ public static void RunBasicFutureTest_Negative() () => { Task.Factory.StartNew((obj) => 42, new object(), CancellationToken.None, TaskCreationOptions.None, (TaskScheduler)null); }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunBasicFutureTest_PromiseTestsAndCancellation() { // @@ -901,7 +901,7 @@ public static void RunBasicFutureTest_PromiseTestsAndCancellation() } // Test the Task.RunSynchronously() API on external and internal threads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunSynchronouslyTest() { Task.Factory.StartNew(delegate { CoreRunSynchronouslyTest(); }).Wait(); @@ -1003,7 +1003,7 @@ public static void CoreRunSynchronouslyTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CoreRunSynchronouslyTest_NegativeTests() { //Executing RunSynchronously() validations on external thread @@ -1057,7 +1057,7 @@ public static void CoreRunSynchronouslyTest_NegativeTests() } // Simply throws an exception from the task and ensures it is propagated. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskExceptionTest() { Task t = Task.Factory.StartNew(delegate { }); @@ -1131,7 +1131,7 @@ private static int NestedLevels(Exception e) return levels; } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskWaitAnyTests() { int numCores = Environment.ProcessorCount; @@ -1171,7 +1171,7 @@ public static void RunTaskWaitAnyTests() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskWaitAnyTests_Negative() { // test exceptions @@ -1248,7 +1248,7 @@ private static void CoreWaitAnyTest(int fillerTasks, bool[] finishMeFirst, int n } // basic WaitAny validations with Cancellation token - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskWaitAnyTests_WithCancellationTokenTests() { //Test stuck tasks + a cancellation token @@ -1334,7 +1334,7 @@ public static void RunTaskWaitAnyTests_WithCancellationTokenTests() } // creates a large number of tasks and does WaitAll on them from a thread of the specified apartment state - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void RunTaskWaitAllTests() { @@ -1585,7 +1585,7 @@ private static void DoRunTaskWaitAllTestWithCancellationToken(bool staThread, } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunLongRunningTaskTests() { TaskScheduler tm = TaskScheduler.Default; @@ -1625,7 +1625,7 @@ public static void RunLongRunningTaskTests() // Various tests to exercise the refactored Task class. // Create()==>Factory.StartNew(), Task and Future ctors have been added, // and Task.Start() has been added. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunRefactoringTests() { int temp = 0; @@ -1901,7 +1901,7 @@ public static void RunRefactoringTests() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunRefactoringTests_NegativeTests() { TaskCompletionSource tr = new TaskCompletionSource(); @@ -2020,7 +2020,7 @@ public static void RunRefactoringTests_NegativeTests() // Test that TaskStatus values returned from Task.Status are what they should be. // TODO: Test WaitingToRun, Blocked. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskStatusTests() { Task t; @@ -2202,7 +2202,7 @@ public static void RunTaskStatusTests() } // Test that TaskStatus values returned from Task.Status are what they should be. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskStatusTests_NegativeTests() { Task t; @@ -2388,7 +2388,7 @@ public static void RunTaskStatusTests_NegativeTests() } // Just runs a task and waits on it. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskWaitTest() { // wait on non-exceptional task @@ -2436,7 +2436,7 @@ public static void RunTaskWaitTest() } // Just runs a task and waits on it. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskWaitTest_NegativeTests() { string exceptionMsg = "myexception"; @@ -2530,7 +2530,7 @@ public static void RunTaskWaitTest_NegativeTests() } // Just runs a task and waits on it. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskRecursiveWaitTest() { Task t2 = null; @@ -2573,7 +2573,7 @@ public static void RunTaskRecursiveWaitTest() } // Just runs a task and waits on it, using a timeout. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskWaitTimeoutTest() { ManualResetEvent mre = new ManualResetEvent(false); @@ -2595,7 +2595,7 @@ public static void RunTaskWaitTimeoutTest() } // Just runs a task and waits on it, using a timeout. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskRecursiveWaitTimeoutTest() { ManualResetEvent taskStartedMRE = new ManualResetEvent(false); @@ -2679,7 +2679,7 @@ public static void RunTaskRecursiveWaitTimeoutTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskCanceledExceptionTests() { TaskCanceledException tce = null; @@ -2729,7 +2729,7 @@ public static void RunTaskSchedulerExceptionTests() Assert.True(tse.Message.Equals(message), "RunTaskSchedulerExceptionTests: Expected Message = message passed to ctor(string, ex)"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunAsyncWaitHandleTests() { // Start a task, but make sure that it does not complete diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskRunSyncTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskRunSyncTests.cs index 8dceb6adf3f88d..6a9310a1a12dcd 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskRunSyncTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskRunSyncTests.cs @@ -411,28 +411,28 @@ static TaskRunSyncTests() #region Test methods - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest0() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Canceled, PostRunSyncAction.Wait, WorkloadType.CreateChildTask, TaskCreationOptions.None, TaskSchedulerType.CustomWithInlineExecution); TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest1() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Canceled, PostRunSyncAction.Wait, WorkloadType.CreateChildTask, TaskCreationOptions.None, TaskSchedulerType.CustomWithoutInlineExecution); TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest2() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Canceled, PostRunSyncAction.Wait, WorkloadType.CreateChildTask, TaskCreationOptions.None, TaskSchedulerType.Default); TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskRunSyncTest3() { @@ -440,35 +440,35 @@ public static void TaskRunSyncTest3() TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest4() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Completed, PostRunSyncAction.Wait, WorkloadType.CreateChildTask, TaskCreationOptions.None, TaskSchedulerType.CustomWithoutInlineExecution); TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest5() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Completed, PostRunSyncAction.Wait, WorkloadType.CreateChildTask, TaskCreationOptions.None, TaskSchedulerType.Default); TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest6() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Continued, PostRunSyncAction.Wait, WorkloadType.CreateChildTask, TaskCreationOptions.None, TaskSchedulerType.CustomWithInlineExecution); TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest7() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Continued, PostRunSyncAction.Wait, WorkloadType.CreateChildTask, TaskCreationOptions.None, TaskSchedulerType.CustomWithoutInlineExecution); TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest8() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Continued, PostRunSyncAction.Wait, WorkloadType.CreateChildTask, TaskCreationOptions.None, TaskSchedulerType.Default); @@ -476,7 +476,7 @@ public static void TaskRunSyncTest8() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest9() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Created, PostRunSyncAction.Cancel, WorkloadType.ContinueInside, TaskCreationOptions.LongRunning, TaskSchedulerType.Default); @@ -484,7 +484,7 @@ public static void TaskRunSyncTest9() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest10() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Created, PostRunSyncAction.Cancel, WorkloadType.CreateChildTask, TaskCreationOptions.LongRunning, TaskSchedulerType.CustomWithoutInlineExecution); @@ -492,7 +492,7 @@ public static void TaskRunSyncTest10() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest11() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Created, PostRunSyncAction.Cancel, WorkloadType.CreateDetachedChildTask, TaskCreationOptions.AttachedToParent, TaskSchedulerType.CustomWithoutInlineExecution); @@ -500,7 +500,7 @@ public static void TaskRunSyncTest11() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest12() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Created, PostRunSyncAction.Cancel, WorkloadType.CreateDetachedChildTask, TaskCreationOptions.None, TaskSchedulerType.CustomWithInlineExecution); @@ -508,14 +508,14 @@ public static void TaskRunSyncTest12() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest13() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Created, PostRunSyncAction.Cancel, WorkloadType.RunWithUserScheduler, TaskCreationOptions.None, TaskSchedulerType.Default); TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest14() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Created, PostRunSyncAction.Cancel, WorkloadType.ThrowException, TaskCreationOptions.AttachedToParent, TaskSchedulerType.CustomWithInlineExecution); @@ -523,7 +523,7 @@ public static void TaskRunSyncTest14() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))] [OuterLoop] public static void TaskRunSyncTest15() @@ -533,7 +533,7 @@ public static void TaskRunSyncTest15() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest16() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Created, PostRunSyncAction.ContinueWith, WorkloadType.CreateChildTask, TaskCreationOptions.AttachedToParent, TaskSchedulerType.Default); @@ -541,7 +541,7 @@ public static void TaskRunSyncTest16() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))] [OuterLoop] public static void TaskRunSyncTest17() @@ -551,7 +551,7 @@ public static void TaskRunSyncTest17() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))] [OuterLoop] public static void TaskRunSyncTest18() @@ -560,7 +560,7 @@ public static void TaskRunSyncTest18() TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))] [OuterLoop] public static void TaskRunSyncTest19() @@ -570,7 +570,7 @@ public static void TaskRunSyncTest19() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))] [OuterLoop] public static void TaskRunSyncTest20() @@ -579,7 +579,7 @@ public static void TaskRunSyncTest20() TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest21() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Created, PostRunSyncAction.Wait, WorkloadType.CreateChildTask, TaskCreationOptions.None, TaskSchedulerType.Null); @@ -587,7 +587,7 @@ public static void TaskRunSyncTest21() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest22() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Created, PostRunSyncAction.Wait, WorkloadType.CreateDetachedChildTask, TaskCreationOptions.LongRunning, TaskSchedulerType.Default); @@ -595,7 +595,7 @@ public static void TaskRunSyncTest22() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [ActiveIssue("https://github.com/dotnet/runtime/issues/89921", typeof(PlatformDetection), nameof(PlatformDetection.IsAlpine), nameof(PlatformDetection.IsMonoRuntime))] [OuterLoop] public static void TaskRunSyncTest23() @@ -604,7 +604,7 @@ public static void TaskRunSyncTest23() TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskRunSyncTest24() { @@ -612,21 +612,21 @@ public static void TaskRunSyncTest24() TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest28() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Running, PostRunSyncAction.Wait, WorkloadType.CreateChildTask, TaskCreationOptions.None, TaskSchedulerType.CustomWithInlineExecution); TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest29() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Running, PostRunSyncAction.Wait, WorkloadType.CreateChildTask, TaskCreationOptions.None, TaskSchedulerType.CustomWithoutInlineExecution); TaskRunSyncTest test = new TaskRunSyncTest(parameters); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskRunSyncTest30() { TestParameters_RunSync parameters = new TestParameters_RunSync(PreTaskStatus.Running, PostRunSyncAction.Wait, WorkloadType.CreateChildTask, TaskCreationOptions.None, TaskSchedulerType.Default); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskStatusTest.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskStatusTest.cs index 72c04df33ecf78..1c49632566e436 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskStatusTest.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskStatusTest.cs @@ -430,7 +430,7 @@ public static void TaskStatus1() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskStatus2() { @@ -442,7 +442,7 @@ public static void TaskStatus2() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskStatus3() { @@ -503,7 +503,7 @@ public static void TaskStatus7() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskStatus8() { @@ -515,7 +515,7 @@ public static void TaskStatus8() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskStatus9() { @@ -530,7 +530,7 @@ public static void TaskStatus9() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskStatus10() { TestParameters parameters = new TestParameters(TestAction.CancelTask) @@ -544,7 +544,7 @@ public static void TaskStatus10() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskStatus11() { TestParameters parameters = new TestParameters(TestAction.FailedTask) @@ -555,7 +555,7 @@ public static void TaskStatus11() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskStatus12() { @@ -570,7 +570,7 @@ public static void TaskStatus12() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskStatus13() { @@ -584,7 +584,7 @@ public static void TaskStatus13() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskStatus14() { TestParameters parameters = new TestParameters(TestAction.FailedChildTask) @@ -598,7 +598,7 @@ public static void TaskStatus14() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskStatus15() { TestParameters parameters = new TestParameters(TestAction.FailedChildTask) @@ -611,7 +611,7 @@ public static void TaskStatus15() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskStatus16() { @@ -626,7 +626,7 @@ public static void TaskStatus16() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskStatus17() { TestParameters parameters = new TestParameters(TestAction.CancelTaskAndAcknowledge) @@ -640,7 +640,7 @@ public static void TaskStatus17() test.RealRun(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(Status_IsProperties_Match_MemberData))] public void Status_IsProperties_Match(StrongBox taskBox) { diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskWaitAllAnyTest.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskWaitAllAnyTest.cs index cb8adbc1792587..1feacd413374a4 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskWaitAllAnyTest.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskWaitAllAnyTest.cs @@ -451,7 +451,7 @@ private bool CheckResult(double result) public sealed class TaskWaitAllAny { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskWaitAllAny0() { @@ -462,7 +462,7 @@ public static void TaskWaitAllAny0() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskWaitAllAny1() { @@ -483,7 +483,7 @@ public static void TaskWaitAllAny2() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny3() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -493,7 +493,7 @@ public static void TaskWaitAllAny3() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny4() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -504,7 +504,7 @@ public static void TaskWaitAllAny4() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskWaitAllAny5() { @@ -521,7 +521,7 @@ public static void TaskWaitAllAny5() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny6() { TaskInfo node1 = new TaskInfo(WorkloadType.Light); @@ -531,7 +531,7 @@ public static void TaskWaitAllAny6() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskWaitAllAny7() { @@ -557,7 +557,7 @@ public static void TaskWaitAllAny8() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny9() { TaskInfo node1 = new TaskInfo(WorkloadType.Heavy); @@ -568,7 +568,7 @@ public static void TaskWaitAllAny9() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny10() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -578,7 +578,7 @@ public static void TaskWaitAllAny10() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny11() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -594,7 +594,7 @@ public static void TaskWaitAllAny11() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny12() { TaskInfo node1 = new TaskInfo(WorkloadType.VeryHeavy); @@ -605,7 +605,7 @@ public static void TaskWaitAllAny12() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny13() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -630,7 +630,7 @@ public static void TaskWaitAllAny14() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny15() { TaskInfo node1 = new TaskInfo(WorkloadType.Heavy); @@ -640,7 +640,7 @@ public static void TaskWaitAllAny15() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny16() { TaskInfo node1 = new TaskInfo(WorkloadType.Heavy); @@ -651,7 +651,7 @@ public static void TaskWaitAllAny16() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny17() { TaskInfo node1 = new TaskInfo(WorkloadType.VeryHeavy); @@ -670,7 +670,7 @@ public static void TaskWaitAllAny18() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny19() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -681,7 +681,7 @@ public static void TaskWaitAllAny19() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny20() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -715,7 +715,7 @@ public static void TaskWaitAllAny22() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny23() { TaskInfo node1 = new TaskInfo(WorkloadType.Heavy); @@ -725,7 +725,7 @@ public static void TaskWaitAllAny23() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny24() { TaskInfo node1 = new TaskInfo(WorkloadType.VeryLight); @@ -736,7 +736,7 @@ public static void TaskWaitAllAny24() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny25() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -761,7 +761,7 @@ public static void TaskWaitAllAny26() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny27() { TaskInfo node1 = new TaskInfo(WorkloadType.Light); @@ -771,7 +771,7 @@ public static void TaskWaitAllAny27() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny28() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -782,7 +782,7 @@ public static void TaskWaitAllAny28() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny29() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -807,7 +807,7 @@ public static void TaskWaitAllAny30() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskWaitAllAny31() { @@ -892,7 +892,7 @@ public static void TaskWaitAllAny32() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskWaitAllAny33() { @@ -903,7 +903,7 @@ public static void TaskWaitAllAny33() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskWaitAllAny34() { @@ -924,7 +924,7 @@ public static void TaskWaitAllAny35() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny36() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -940,7 +940,7 @@ public static void TaskWaitAllAny36() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskWaitAllAny37() { @@ -952,7 +952,7 @@ public static void TaskWaitAllAny37() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny38() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -962,7 +962,7 @@ public static void TaskWaitAllAny38() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny39() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -987,7 +987,7 @@ public static void TaskWaitAllAny40() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny41() { TaskInfo node1 = new TaskInfo(WorkloadType.VeryLight); @@ -1007,7 +1007,7 @@ public static void TaskWaitAllAny42() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny43() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -1017,7 +1017,7 @@ public static void TaskWaitAllAny43() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny44() { TaskInfo node1 = new TaskInfo(WorkloadType.Heavy); @@ -1028,7 +1028,7 @@ public static void TaskWaitAllAny44() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void TaskWaitAllAny45() { @@ -1116,7 +1116,7 @@ public static void TaskWaitAllAny46() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny47() { TaskInfo node1 = new TaskInfo(WorkloadType.VeryHeavy); @@ -1127,7 +1127,7 @@ public static void TaskWaitAllAny47() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny48() { TaskInfo node1 = new TaskInfo(WorkloadType.Heavy); @@ -1143,7 +1143,7 @@ public static void TaskWaitAllAny48() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny49() { TaskInfo node1 = new TaskInfo(WorkloadType.Heavy); @@ -1153,7 +1153,7 @@ public static void TaskWaitAllAny49() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny50() { TaskInfo node1 = new TaskInfo(WorkloadType.Light); @@ -1163,7 +1163,7 @@ public static void TaskWaitAllAny50() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny51() { TaskInfo node1 = new TaskInfo(WorkloadType.Light); @@ -1174,7 +1174,7 @@ public static void TaskWaitAllAny51() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny52() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); @@ -1199,7 +1199,7 @@ public static void TaskWaitAllAny53() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny54() { TaskInfo node1 = new TaskInfo(WorkloadType.Heavy); @@ -1210,7 +1210,7 @@ public static void TaskWaitAllAny54() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny55() { TaskInfo node1 = new TaskInfo(WorkloadType.Light); @@ -1220,7 +1220,7 @@ public static void TaskWaitAllAny55() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny56() { TaskInfo node1 = new TaskInfo(WorkloadType.Heavy); @@ -1231,7 +1231,7 @@ public static void TaskWaitAllAny56() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TaskWaitAllAny57() { TaskInfo node1 = new TaskInfo(WorkloadType.Medium); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskFactory/TaskFactoryTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskFactory/TaskFactoryTests.cs index 9ec820403ebcd3..41795ab0913122 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskFactory/TaskFactoryTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskFactory/TaskFactoryTests.cs @@ -12,7 +12,7 @@ public class TaskFactoryTests #region Test Methods // Exercise functionality of TaskFactory and TaskFactory - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunTaskFactoryTests() { TaskScheduler tm = TaskScheduler.Default; diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskFactory/TaskFactory_FromAsyncTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskFactory/TaskFactory_FromAsyncTests.cs index 597f3136dc1cd1..c30f083824004e 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskFactory/TaskFactory_FromAsyncTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskFactory/TaskFactory_FromAsyncTests.cs @@ -11,7 +11,7 @@ namespace System.Threading.Tasks.Tests public class TaskFactory_FromAsyncTests { // Exercise the FromAsync() methods in Task and Task. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunAPMFactoryTests() { FakeAsyncClass fac = new FakeAsyncClass(); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskScheduler/TaskSchedulerTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskScheduler/TaskSchedulerTests.cs index 0d659d7cd03b84..ef1b97dbe4faa9 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskScheduler/TaskSchedulerTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskScheduler/TaskSchedulerTests.cs @@ -50,7 +50,7 @@ public static void RunBlockedInjectionTest() Task.WaitAll(tasks); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunBuggySchedulerTests() { Debug.WriteLine("* RunBuggySchedulerTests()"); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/UnwrapTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/UnwrapTests.cs index 4d28e59e39d995..cc332fb6c68a1b 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/UnwrapTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/UnwrapTests.cs @@ -453,7 +453,7 @@ public void NonGeneric_DefaultSchedulerUsed() /// /// Test that Unwrap with a generic task doesn't use TaskScheduler.Current. /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Generic_DefaultSchedulerUsed() { var scheduler = new CountingScheduler(); @@ -473,7 +473,7 @@ public void Generic_DefaultSchedulerUsed() /// /// Test that a long chain of Unwraps can execute without overflowing the stack. /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void RunStackGuardTests() { const int DiveDepth = 12000; diff --git a/src/libraries/System.Runtime/tests/System.Threading.Timer.Tests/TimerDisposeTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Timer.Tests/TimerDisposeTests.cs index 81cf68b4f2c6d8..a50a05bd5fa024 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Timer.Tests/TimerDisposeTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Timer.Tests/TimerDisposeTests.cs @@ -49,7 +49,7 @@ public void DisposeAsync_SignalsImmediatelyWhenTaskNotRunning() Assert.True(t.DisposeAsync().IsCompletedSuccessfully); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task DisposeAsync_DisposeDelayedUntilCallbacksComplete() { using (var b = new Barrier(2)) @@ -71,7 +71,7 @@ public async Task DisposeAsync_DisposeDelayedUntilCallbacksComplete() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task DisposeAsync_MultipleDisposesBeforeCompletionReturnSameTask() { using (var b = new Barrier(2)) @@ -96,7 +96,7 @@ public async Task DisposeAsync_MultipleDisposesBeforeCompletionReturnSameTask() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task DisposeAsync_AfterDisposeWorks() { using (var b = new Barrier(2)) @@ -119,7 +119,7 @@ public async Task DisposeAsync_AfterDisposeWorks() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task DisposeAsync_AfterDisposeWaitHandleThrows() { using (var b = new Barrier(2)) @@ -141,7 +141,7 @@ public async Task DisposeAsync_AfterDisposeWaitHandleThrows() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task DisposeAsync_ThenDisposeWaitHandleReturnsFalse() { using (var b = new Barrier(2)) diff --git a/src/libraries/System.Runtime/tests/System.Threading.Timer.Tests/TimerFiringTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Timer.Tests/TimerFiringTests.cs index 046de9ad6fb1d4..1ab54f8bc5ca43 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Timer.Tests/TimerFiringTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Timer.Tests/TimerFiringTests.cs @@ -16,7 +16,7 @@ public class TimerFiringTests { internal const int MaxPositiveTimeoutInMs = 30000; - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Timer_Fires_After_DueTime_Ellapses() { AutoResetEvent are = new AutoResetEvent(false); @@ -30,7 +30,7 @@ public void Timer_Fires_After_DueTime_Ellapses() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Timer_Fires_AndPassesStateThroughCallback() { AutoResetEvent are = new AutoResetEvent(false); @@ -46,7 +46,7 @@ public void Timer_Fires_AndPassesStateThroughCallback() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Timer_Fires_AndPassesNullStateThroughCallback() { AutoResetEvent are = new AutoResetEvent(false); @@ -62,7 +62,7 @@ public void Timer_Fires_AndPassesNullStateThroughCallback() } [OuterLoop("Several second delays")] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // values chosen based on knowing the 333 pivot used in implementation + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] // values chosen based on knowing the 333 pivot used in implementation [InlineData(1, 1)] [InlineData(50, 50)] [InlineData(250, 50)] @@ -87,7 +87,7 @@ public void Timer_Fires_After_DueTime_AndOn_Period(int dueTime, int period) } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Timer_FiresOnlyOnce_OnDueTime_With_InfinitePeriod() { int count = 0; @@ -106,7 +106,7 @@ public void Timer_FiresOnlyOnce_OnDueTime_With_InfinitePeriod() } [OuterLoop("Waits seconds")] - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Timer_ChangeToDelete_DoesntFire() { RetryHelper.Execute(() => @@ -121,7 +121,7 @@ public void Timer_ChangeToDelete_DoesntFire() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Timer_CanDisposeSelfInCallback() { Timer t = null; @@ -148,7 +148,7 @@ public void Timer_CanBeDisposedMultipleTimes() t.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void NonRepeatingTimer_ThatHasAlreadyFired_CanChangeAndFireAgain() { AutoResetEvent are = new AutoResetEvent(false); @@ -162,7 +162,7 @@ public void NonRepeatingTimer_ThatHasAlreadyFired_CanChangeAndFireAgain() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void MultpleTimers_PeriodicTimerIsntBlockedByBlockedCallback() { int callbacks = 2; @@ -182,7 +182,7 @@ public void MultpleTimers_PeriodicTimerIsntBlockedByBlockedCallback() GC.KeepAlive(t); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void ManyTimers_EachTimerDoesFire() { int maxTimers = 10000; @@ -199,7 +199,7 @@ public void ManyTimers_EachTimerDoesFire() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Timer_Constructor_CallbackOnly_Change() { var e = new ManualResetEvent(false); @@ -216,7 +216,7 @@ public void Timer_Dispose_WaitHandle_Negative() Assert.Throws(() => new Timer(s => { }).Dispose(null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Timer_Dispose_WaitHandle() { int tickCount = 0; @@ -273,7 +273,7 @@ select Task.Run(async () => } [OuterLoop("Takes several seconds")] - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task Timer_ManyDifferentPeriodicTimes_AllFireSuccessfully() { await Task.WhenAll(from p in Enumerable.Range(0, Environment.ProcessorCount) @@ -286,7 +286,8 @@ select Task.Run(async () => [SkipOnPlatform(TestPlatforms.OSX | TestPlatforms.Browser, "macOS and Browser in CI appears to have a lot more variation")] [OuterLoop("Takes several seconds")] - [Theory] // selection based on 333ms threshold used by implementation + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] + // selection based on 333ms threshold used by implementation [InlineData(new int[] { 15 })] [InlineData(new int[] { 333 })] [InlineData(new int[] { 332, 333, 334 })] @@ -361,7 +362,7 @@ orderby groupedByDueTime.Key } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TimersCreatedConcurrentlyOnDifferentThreadsAllFire() { int processorCount = Environment.ProcessorCount; diff --git a/src/libraries/System.Security.Cryptography/tests/RandomNumberGeneratorTests.cs b/src/libraries/System.Security.Cryptography/tests/RandomNumberGeneratorTests.cs index f7b4ad2de4f772..b9e4a7c7825bcc 100644 --- a/src/libraries/System.Security.Cryptography/tests/RandomNumberGeneratorTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/RandomNumberGeneratorTests.cs @@ -83,7 +83,7 @@ public static void ZeroLengthInput() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ConcurrentAccess() { const int ParallelTasks = 3; diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/JsonArrayTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/JsonArrayTests.cs index ef51703958151c..14cf4950ca1b6a 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/JsonArrayTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/JsonArrayTests.cs @@ -475,7 +475,7 @@ public static void GetJsonArrayIEnumerable() Assert.Equal("value", ((JsonValue)jArrayEnumerator.Current).GetValue()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void LazyInitializationIsThreadSafe() { string arrayText = "[\"elem0\",\"elem1\"]"; diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/JsonObjectTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/JsonObjectTests.cs index 9e505ea65057b6..200d43271e68df 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/JsonObjectTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonNode/JsonObjectTests.cs @@ -958,7 +958,7 @@ static void Test(JsonObject jObject) } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void LazyInitializationIsThreadSafe() { string arrayText = "{\"prop0\":0,\"prop1\":1}"; diff --git a/src/libraries/System.Threading.Channels/tests/BoundedChannelTests.cs b/src/libraries/System.Threading.Channels/tests/BoundedChannelTests.cs index 62e5643475826d..902724bbced49d 100644 --- a/src/libraries/System.Threading.Channels/tests/BoundedChannelTests.cs +++ b/src/libraries/System.Threading.Channels/tests/BoundedChannelTests.cs @@ -360,7 +360,7 @@ void AddDroppedItem(int itemDropped) Assert.Equal(10, droppedItems.Count); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(ChannelDropModes))] public void DroppedDelegateCalledAfterLockReleased_SyncWrites(BoundedChannelFullMode boundedChannelFullMode) { @@ -399,7 +399,7 @@ public void DroppedDelegateCalledAfterLockReleased_SyncWrites(BoundedChannelFull Assert.True(dropDelegateCalled); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(ChannelDropModes))] public async Task DroppedDelegateCalledAfterLockReleased_AsyncWrites(BoundedChannelFullMode boundedChannelFullMode) { @@ -511,7 +511,7 @@ public void TryWrite_TryRead_OneAtATime(int bufferedCapacity) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(1)] [InlineData(10)] [InlineData(10000)] @@ -537,7 +537,7 @@ public void SingleProducerConsumer_ConcurrentReadWrite_WithBufferedCapacity_Succ })); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(1)] [InlineData(10)] [InlineData(10000)] diff --git a/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs b/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs index cefa3fe6f29901..f1f7f03d880e2e 100644 --- a/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs +++ b/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs @@ -144,7 +144,7 @@ public void Count_ThrowsIfUnsupported() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [ActiveIssue("https://github.com/dotnet/runtime/issues/60472", TestPlatforms.iOS | TestPlatforms.tvOS)] public void SingleProducerConsumer_ConcurrentReadWrite_Success() { @@ -168,7 +168,7 @@ public void SingleProducerConsumer_ConcurrentReadWrite_Success() })); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [ActiveIssue("https://github.com/dotnet/runtime/issues/60472", TestPlatforms.iOS | TestPlatforms.tvOS)] public void SingleProducerConsumer_PingPong_Success() { @@ -195,7 +195,7 @@ public void SingleProducerConsumer_PingPong_Success() })); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(1, 1)] [InlineData(1, 10)] [InlineData(10, 1)] diff --git a/src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs b/src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs index 336d8b3b755dc4..0aeb41d57b2ccf 100644 --- a/src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs +++ b/src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs @@ -207,7 +207,7 @@ public async Task MultipleReaders_CancelsPreviousReader() Assert.Equal(42, await t2); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Stress_TryWrite_TryRead() { const int NumItems = 3000000; diff --git a/src/libraries/System.Threading.RateLimiting/tests/PartitionedRateLimiterTests.cs b/src/libraries/System.Threading.RateLimiting/tests/PartitionedRateLimiterTests.cs index b0380a0dcd6a4f..fcbb94da74917f 100644 --- a/src/libraries/System.Threading.RateLimiting/tests/PartitionedRateLimiterTests.cs +++ b/src/libraries/System.Threading.RateLimiting/tests/PartitionedRateLimiterTests.cs @@ -157,7 +157,7 @@ public async Task Create_BlockingWaitDoesNotBlockOtherPartitions() } // Uses Task.Wait in a Task.Run to purposefully test a blocking scenario, this doesn't work on WASM currently - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task Create_BlockingFactoryDoesNotBlockOtherPartitions() { var limiterFactory = new TrackingRateLimiterFactory(); @@ -393,7 +393,7 @@ public async Task Create_WithTokenBucketReplenishesAutomatically() Assert.True(lease.IsAcquired); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task Create_WithReplenishingLimiterReplenishesAutomatically() { using var limiter = PartitionedRateLimiter.Create(resource => @@ -418,7 +418,7 @@ public async Task Create_WithReplenishingLimiterReplenishesAutomatically() Assert.True(lease.IsAcquired); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task Create_MultipleReplenishingLimitersReplenishAutomatically() { using var limiter = PartitionedRateLimiter.Create(resource => diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/ActionBlockTests.cs b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/ActionBlockTests.cs index 4b7dea50557c32..58b536c28ccbe9 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/ActionBlockTests.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/ActionBlockTests.cs @@ -196,7 +196,7 @@ public async Task TestSchedulerUsage() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task TestInputCount() { foreach (bool sync in DataflowTestHelpers.BooleanValues) @@ -253,7 +253,7 @@ public async Task TestOrderMaintained() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task TestNonGreedy() { foreach (bool sync in DataflowTestHelpers.BooleanValues) @@ -419,7 +419,7 @@ public async Task TestNullReturnedTasks() actual: sumOfOdds); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task TestParallelExecution() { int dop = 2; @@ -439,7 +439,7 @@ public async Task TestParallelExecution() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task TestReleasingOfPostponedMessages() { foreach (bool sync in DataflowTestHelpers.BooleanValues) diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/BufferBlockTests.cs b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/BufferBlockTests.cs index 3b107b4d55ec2b..26d3e3f519f94e 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/BufferBlockTests.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/BufferBlockTests.cs @@ -570,7 +570,7 @@ public async Task TestReleasingFailsAtCompletion() await Assert.ThrowsAsync(() => bb.Completion); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task TestSynchronousWaitForCompletionDoesNotDeadlock() { SynchronizationContext origContext = SynchronizationContext.Current; diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/ConcurrentTests.cs b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/ConcurrentTests.cs index 3e3675ee5af75d..a531e88002025f 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/ConcurrentTests.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/ConcurrentTests.cs @@ -11,7 +11,7 @@ namespace System.Threading.Tasks.Dataflow.Tests { public class ConcurrentTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public async Task StressTargetCorePostponement() { @@ -55,7 +55,7 @@ public async Task StressTargetCorePostponement() static readonly int s_dop = Environment.ProcessorCount * 2; const int IterationCount = 10000; - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] // should be a stress test that runs for a while, but needs cleanup public void RunConcurrentTests() { diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/DataflowBlockExtensionTests.cs b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/DataflowBlockExtensionTests.cs index c5f3d609c2f089..4824fb9f387979 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/DataflowBlockExtensionTests.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/DataflowBlockExtensionTests.cs @@ -454,7 +454,7 @@ public void TestLinkTo_ArgumentValidation() Assert.Throws(() => source.LinkTo(target, null, i => true)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void TestLinkTo_TwoPhaseCommit() { var source1 = new BufferBlock(); @@ -478,7 +478,7 @@ public void TestLinkTo_TwoPhaseCommit() Assert.Equal(expected: 43, actual: tuple.Item2); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task TestLinkTo_DoubleLinking() { foreach (bool greedy in DataflowTestHelpers.BooleanValues) @@ -971,7 +971,7 @@ public async Task TestReceive_AlreadyAvailable() Assert.Equal(expected: 0, actual: buffer.Count); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task TestReceive_NotYetAvailable() { var buffer = new BufferBlock(); @@ -1005,7 +1005,7 @@ public async Task TestReceive_NotYetAvailable() Assert.Equal(expected: 6, actual: await t4); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] // timeout involved public async Task TestReceive_Timeout() { @@ -1028,7 +1028,7 @@ public async Task TestReceive_TimeoutZero() } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task TestReceive_Cancellation() { var bb = new BufferBlock(); @@ -1070,7 +1070,7 @@ public async Task TestReceive_Cancellation() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task TestReceive_CanceledSource() { foreach (bool beforeReceive in DataflowTestHelpers.BooleanValues) @@ -1711,7 +1711,7 @@ public void TestEncapsulate_ArgumentValidation() () => DataflowBlock.Encapsulate(new BufferBlock(), new BufferBlock()).Fault(null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void TestEncapsulate_LinkingAndUnlinking() { var buffer = new BufferBlock(); diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformBlockTests.cs b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformBlockTests.cs index f65cbde49517a5..cfc302837674ef 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformBlockTests.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformBlockTests.cs @@ -285,7 +285,7 @@ public async Task TestCountZeroAtCompletion() Assert.Equal(expected: 0, actual: tb.OutputCount); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void TestInputCount() { foreach (bool sync in DataflowTestHelpers.BooleanValues) @@ -315,7 +315,7 @@ public void TestInputCount() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] // spins waiting for a condition to be true, though it should happen very quickly public async Task TestCount() { @@ -640,7 +640,7 @@ public async Task TestOrdering_Async_OrderedDisabled() await tb.Completion; } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task TestOrdering_Sync_OrderedDisabled() { // If ordering were enabled, this test would hang. diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformManyBlockTests.IAsyncEnumerable.cs b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformManyBlockTests.IAsyncEnumerable.cs index aa2190c85ee4ec..19284c4eba1c3d 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformManyBlockTests.IAsyncEnumerable.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformManyBlockTests.IAsyncEnumerable.cs @@ -304,7 +304,7 @@ public async Task TestCountZeroAtCompletionAsyncEnumerable() Assert.Equal(expected: 0, actual: tb.OutputCount); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void TestInputCountAsyncEnumerable() { using Barrier barrier1 = new Barrier(2), barrier2 = new Barrier(2); @@ -330,7 +330,7 @@ IAsyncEnumerable body(int item) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] // spins waiting for a condition to be true, though it should happen very quickly public async Task TestCountAsyncEnumerable() { @@ -630,7 +630,7 @@ public async Task TestOrdering_Sync_OrderedEnabledAsyncEnumerable(int mmpt, int await tb.Completion; } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(true)] [InlineData(false)] public async Task TestOrdering_Sync_OrderedDisabledAsyncEnumerable(bool trustedEnumeration) @@ -658,7 +658,7 @@ public async Task TestOrdering_Sync_OrderedDisabledAsyncEnumerable(bool trustedE await tb.Completion; } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(false)] [InlineData(true)] public async Task TestOrdering_Sync_BlockingEnumeration_NoDeadlockAsyncEnumerable(bool ensureOrdered) diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformManyBlockTests.cs b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformManyBlockTests.cs index 0e02327978f4f6..46a6c0ac6345c4 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformManyBlockTests.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/TransformManyBlockTests.cs @@ -313,7 +313,7 @@ public async Task TestCountZeroAtCompletion() Assert.Equal(expected: 0, actual: tb.OutputCount); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void TestInputCount() { foreach (bool sync in DataflowTestHelpers.BooleanValues) @@ -343,7 +343,7 @@ public void TestInputCount() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] // spins waiting for a condition to be true, though it should happen very quickly public async Task TestCount() { @@ -753,7 +753,7 @@ public async Task TestOrdering_Async_OrderedDisabled(bool trustedEnumeration) await tb.Completion; } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(true)] [InlineData(false)] public async Task TestOrdering_Sync_OrderedDisabled(bool trustedEnumeration) @@ -781,7 +781,7 @@ public async Task TestOrdering_Sync_OrderedDisabled(bool trustedEnumeration) await tb.Completion; } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(false)] [InlineData(true)] public async Task TestOrdering_Sync_BlockingEnumeration_NoDeadlock(bool ensureOrdered) diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/WriteOnceBlockTests.cs b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/WriteOnceBlockTests.cs index d6ff711d17f9cb..09a5db5a6f7e72 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/WriteOnceBlockTests.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/WriteOnceBlockTests.cs @@ -173,7 +173,7 @@ public async Task TestPostThenReceive() await wob.Completion; } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task TestReceiveThenPost() { var wob = new WriteOnceBlock(null); diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/BreakTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/BreakTests.cs index 526f944a10350c..894cb90a00ddbb 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/BreakTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/BreakTests.cs @@ -10,7 +10,7 @@ namespace System.Threading.Tasks.Tests { public static class BreakTests { - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(100, 10)] [InlineData(100, 20)] [InlineData(1000, 100)] @@ -46,7 +46,7 @@ public static void TestFor_Break_Basic(int loopsize, int breakpoint) Assert.True(result, "TestForBreak: Failed: Could not detect any interruption of For-loop."); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(100, 10)] [InlineData(100, 20)] [InlineData(1000, 100)] @@ -86,7 +86,7 @@ public static void TestFor_Break_64Bits(int loopsize, int breakpoint) Assert.True(result, "TestFor64Break: Failed: Could not detect any interruption of For-loop."); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(500, 10)] [InlineData(500, 20)] [InlineData(1000, 100)] diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelFor.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelFor.cs index 34bc14d7d87214..2406ff5b709074 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelFor.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelFor.cs @@ -7,7 +7,7 @@ namespace System.Threading.Tasks.Tests { public static class ParallelForUnitTests { - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(API.For64, StartIndexBase.Int32, 0, WithParallelOption.None, ActionWithState.None, ActionWithLocal.None)] [InlineData(API.For64, StartIndexBase.Int32, 10, WithParallelOption.None, ActionWithState.Stop, ActionWithLocal.HasFinally)] [InlineData(API.For64, StartIndexBase.Int32, 10, WithParallelOption.WithDOP, ActionWithState.None, ActionWithLocal.None)] diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs index 77c16ddd72c928..ea5dc96a3af77e 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs @@ -1283,7 +1283,7 @@ await Assert.ThrowsAsync(() => Parallel.ForEachAsync(Iterate(), async })); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void Exception_LockWaitAsyncCancellationDoesntPropagate() { static async IAsyncEnumerable Iterate(Task signal) diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs index 8093dc661b87c3..72d231e221de31 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs @@ -205,7 +205,7 @@ public static void RunParallelExceptionTests() } // Cover converting P.ForEaches of arrays, lists to P.Fors - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestParallelForEachConversions() { ParallelOptions options = new ParallelOptions(); @@ -258,7 +258,7 @@ public static void TestParallelForEachConversions() Assert.Equal(sum, targetSum); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -282,7 +282,7 @@ public static void RunSimpleParallelDoTest(int increms) Assert.Equal(increms, counter); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(-1)] [InlineData(0)] [InlineData(1)] @@ -318,7 +318,7 @@ public static void RunSimpleParallelForIncrementTest(int increms) Assert.Equal(expectedValue, counter); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(-1)] [InlineData(0)] [InlineData(1)] @@ -341,7 +341,7 @@ public static void RunSimpleParallelFor64IncrementTest(long increms) Assert.Equal(expected, counter); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -368,7 +368,7 @@ public static void RunSimpleParallelForAddTest(int count) Assert.Equal(expectCounter, counter); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -394,7 +394,7 @@ public static void RunSimpleParallelFor64AddTest(long count) Assert.Equal(expectCounter, counter); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(0, 100)] [InlineData(-100, 100)] [InlineData(int.MaxValue - 1, int.MaxValue)] @@ -420,7 +420,7 @@ public static void SequentialForParityTest(int inclusiveFrom, int exclusiveTo) Assert.Equal(seqForIndices, parForIndices); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(0, 100)] [InlineData(-100, 100)] [InlineData((long)int.MaxValue - 100, (long)int.MaxValue + 100)] @@ -451,7 +451,7 @@ public static void SequentialFor64ParityTest(long inclusiveFrom, long exclusiveT Assert.Equal(seqForIndices, parForIndices); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -480,7 +480,7 @@ public static void RunSimpleParallelForeachAddTest_Enumerable(int count) Assert.Equal(expectCounter, counter); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -510,7 +510,7 @@ public static void RunSimpleParallelForeachAddTest_List(int count) Assert.Equal(expectCounter, counter); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -540,7 +540,7 @@ public static void RunSimpleParallelForeachAddTest_Array(int count) Assert.Equal(expectCounter, counter); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -571,7 +571,7 @@ public static void RunSimpleParallelForAverageAggregation(int count) Assert.Equal(expectedTotal, sum); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -710,7 +710,7 @@ public static void TestParallelForDOP() Assert.False(exceededDOP, string.Format("TestParallelForDOP: FAILED! ForEach-loop w/ OrderablePartitioner exceeded desired DOP ({0} > {1}).", maxDOP, desiredDOP)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestParallelForPaths() { int loopsize = 1000; @@ -884,7 +884,7 @@ public static void TestParallelForPaths_Exceptions() Assert.Throws(() => Parallel.ForEach(mop, delegate (int item, ParallelLoopState state, long index) { })); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestParallelScheduler() { ParallelOptions parallelOptions = new ParallelOptions(); @@ -991,7 +991,7 @@ public static void TestParallelScheduler() t1.Wait(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TestInvokeDOPAndCancel() { ParallelOptions parallelOptions = null; @@ -1242,7 +1242,7 @@ private static void VerifyCancelTestState( } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancelForIntTest() { for (int i = 0; i < 100; ++i) @@ -1276,7 +1276,7 @@ public static void CancelForIntTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancelForLongTest() { for (int i = 0; i < 100; ++i) @@ -1317,7 +1317,7 @@ public static IEnumerable CancelForEachTest_MemberData() yield return new object[] { array.Select(i => i) }; } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(CancelForEachTest_MemberData))] public static void CancelForEachTest(IEnumerable enumerable) { diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelInvokeTest.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelInvokeTest.cs index 9f2b148b5e1a24..d310f17b44d5df 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelInvokeTest.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelInvokeTest.cs @@ -150,7 +150,7 @@ public static void ParallelInvoke1() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ParallelInvoke2() { ParallelInvokeTestParameters parameters = new ParallelInvokeTestParameters @@ -162,7 +162,7 @@ public static void ParallelInvoke2() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ParallelInvoke3() { ParallelInvokeTestParameters parameters = new ParallelInvokeTestParameters @@ -198,7 +198,7 @@ public static void ParallelInvoke5() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ParallelInvoke6() { ParallelInvokeTestParameters parameters = new ParallelInvokeTestParameters @@ -210,7 +210,7 @@ public static void ParallelInvoke6() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ParallelInvoke7() { ParallelInvokeTestParameters parameters = new ParallelInvokeTestParameters @@ -246,7 +246,7 @@ public static void ParallelInvoke9() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ParallelInvoke10() { ParallelInvokeTestParameters parameters = new ParallelInvokeTestParameters @@ -258,7 +258,7 @@ public static void ParallelInvoke10() test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ParallelInvoke11() { ParallelInvokeTestParameters parameters = new ParallelInvokeTestParameters diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelLoopResultTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelLoopResultTests.cs index 430eabdfa01bb7..c060a9ac2d41b4 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelLoopResultTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelLoopResultTests.cs @@ -10,7 +10,7 @@ namespace System.Threading.Tasks.Tests { public static class ParallelLoopResultTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ForPLRTests() { ParallelLoopResult plr = @@ -44,7 +44,7 @@ public static void ForPLRTests() PLRcheck(plr, "For-Completion", true, null); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ForPLR64Tests() { ParallelLoopResult plr = @@ -78,7 +78,7 @@ public static void ForPLR64Tests() PLRcheck(plr, "For64-Completion", true, null); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ForEachPLRTests() { Dictionary dict = new Dictionary(); @@ -122,7 +122,7 @@ public static void ForEachPLRTests() PLRcheck(plr, "ForEach-Complete", true, null); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void PartitionerForEachPLRTests() { // @@ -144,7 +144,7 @@ public static void PartitionerForEachPLRTests() PLRcheck(plr, "Partitioner-ForEach-Complete", true, null); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void OrderablePartitionerForEachTests() { List intlist = new List(); @@ -372,7 +372,7 @@ private static void OrderablePartitionerForEachPLRTest( } // Perform tests on various combinations of Stop()/Break() - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void SimultaneousStopBreakTests() { // diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitioner1Chunk.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitioner1Chunk.cs index b7eece1c2de61d..d99768339aecab 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitioner1Chunk.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitioner1Chunk.cs @@ -100,7 +100,7 @@ static void oneMoveNext(int length, bool isOrderable) /// Test that in a parallel Foreach loop can be dependencies between iterations if a partitioner of chunk size 1 is used /// /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void IterationsWithDependency() { static void iterationsWithDependency(int length, int dependencyIndex) @@ -140,7 +140,7 @@ static void iterationsWithDependency(int length, int dependencyIndex) /// Verify that the enumerators used while executing the ParalleForEach over the partitioner are disposed /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void PFEDisposeEnum() { List ds = new List(); @@ -165,7 +165,7 @@ public static void PFEDisposeEnum() /// Partitioner is used in ParallelForEach /// Exception is expected and the enumerators are disposed /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ExceptionOnMoveNext() { static void exceptionOnMoveNext(int length, int indexToThrow, bool isOrderable) diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerTests.cs index 87e427d0837ece..176be6c7af5631 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerTests.cs @@ -9,7 +9,7 @@ namespace System.Threading.Tasks.Tests { public static class RangePartitionerTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunPartitionerStaticTest_SingleChunking() { CountdownEvent cde = new CountdownEvent(2); @@ -40,7 +40,7 @@ public static void RunPartitionerStaticTest_SingleChunking_Negative() } // Test proper range coverage - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RangePartitionerCoverageTest() { RangePartitionerCoverageTest_HelperInt(0, 1, -1); @@ -82,7 +82,7 @@ public static void RangePartitionerCoverageTest() } // Test that chunk sizes are being honored - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RangePartitionerChunkTest() { RangePartitionerChunkTest_HelperInt(0, 10, 1); diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerThreadSafetyTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerThreadSafetyTests.cs index 8cbc900cbb6bdd..481fd48222f8ce 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerThreadSafetyTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerThreadSafetyTests.cs @@ -24,7 +24,7 @@ public static class RangePartitionerThreadSafetyTests /// /// Make sure that range Partitioner.Create can be called from multiple threads /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void IntPartitionerThreadSafety() { ConcurrentBag>> bag = new ConcurrentBag>>(); @@ -60,7 +60,7 @@ public static void IntPartitionerThreadSafety() /// /// Make sure that range Partitioner.Create(long overload) can be called from multiple threads /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void LongPartitionerThreadSafety() { ConcurrentBag>> bag = new ConcurrentBag>>(); diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/RespectParentCancellationTest.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/RespectParentCancellationTest.cs index 3f613086d5d474..56cfd48ac174fc 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/RespectParentCancellationTest.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/RespectParentCancellationTest.cs @@ -93,21 +93,21 @@ public enum API public static class TestMethods { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RespectParentCancellation1() { RespectParentCancellationTest test = new RespectParentCancellationTest(API.For); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RespectParentCancellation2() { RespectParentCancellationTest test = new RespectParentCancellationTest(API.For64); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RespectParentCancellation3() { RespectParentCancellationTest test = new RespectParentCancellationTest(API.Foreach); diff --git a/src/libraries/System.Threading.ThreadPool/tests/RegisteredWaitTests.cs b/src/libraries/System.Threading.ThreadPool/tests/RegisteredWaitTests.cs index 4dfcdf20edcef1..339bbffb41efcf 100644 --- a/src/libraries/System.Threading.ThreadPool/tests/RegisteredWaitTests.cs +++ b/src/libraries/System.Threading.ThreadPool/tests/RegisteredWaitTests.cs @@ -16,7 +16,7 @@ private sealed class InvalidWaitHandle : WaitHandle { } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void QueueRegisterPositiveAndFlowTest() { var asyncLocal = new AsyncLocal(); @@ -146,7 +146,7 @@ public static void QueueRegisterPositiveAndFlowTest() Assert.Equal(0, backgroundAsyncLocalValue); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void QueueRegisterNegativeTest() { Assert.Throws(() => ThreadPool.QueueUserWorkItem(null)); @@ -191,7 +191,7 @@ public static void QueueRegisterNegativeTest() true)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void SignalingRegisteredWaitHandleCallsCallback() { var waitEvent = new AutoResetEvent(false); @@ -208,7 +208,7 @@ public static void SignalingRegisteredWaitHandleCallsCallback() Assert.False(timedOut); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void TimingOutRegisteredWaitHandleCallsCallback() { var waitEvent = new AutoResetEvent(false); @@ -224,7 +224,7 @@ public static void TimingOutRegisteredWaitHandleCallsCallback() Assert.True(timedOut); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void UnregisteringWaitWithInvalidWaitHandleBeforeSignalingDoesNotCallCallback() { var waitEvent = new AutoResetEvent(false); @@ -239,7 +239,7 @@ public static void UnregisteringWaitWithInvalidWaitHandleBeforeSignalingDoesNotC Assert.False(waitCallbackInvoked.WaitOne(ExpectedTimeoutMilliseconds)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void UnregisteringWaitWithEventBeforeSignalingDoesNotCallCallback() { var waitEvent = new AutoResetEvent(false); @@ -256,7 +256,7 @@ public static void UnregisteringWaitWithEventBeforeSignalingDoesNotCallCallback( Assert.False(waitCallbackInvoked.WaitOne(ExpectedTimeoutMilliseconds)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void NonrepeatingWaitFiresOnlyOnce() { var waitEvent = new AutoResetEvent(false); @@ -275,7 +275,7 @@ public static void NonrepeatingWaitFiresOnlyOnce() Assert.False(anyTimedOut); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RepeatingWaitFiresUntilUnregistered() { var waitEvent = new AutoResetEvent(false); @@ -299,7 +299,7 @@ public static void RepeatingWaitFiresUntilUnregistered() Assert.False(anyTimedOut); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void UnregisterEventSignaledWhenUnregistered() { var waitEvent = new AutoResetEvent(false); @@ -350,7 +350,7 @@ public static void UnregisterEventSignaledWhenUnregistered() Assert.False(timedOut); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CanRegisterMoreThan64Waits() { RegisteredWaitHandle[] registeredWaitHandles = new RegisteredWaitHandle[65]; @@ -367,7 +367,7 @@ public static void CanRegisterMoreThan64Waits() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void StateIsPassedThroughToCallback() { object state = new object(); @@ -383,7 +383,7 @@ public static void StateIsPassedThroughToCallback() Assert.Same(state, statePassedToCallback); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void UnregisterWaitHandleIsNotSignaledWhenCallbackIsRunning() { var waitEvent = new AutoResetEvent(false); @@ -411,7 +411,7 @@ public static void UnregisterWaitHandleIsNotSignaledWhenCallbackIsRunning() waitUnregistered.CheckedWait(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void BlockingUnregisterBlocksWhileCallbackIsRunning() { var waitEvent = new AutoResetEvent(false); @@ -443,7 +443,7 @@ public static void BlockingUnregisterBlocksWhileCallbackIsRunning() waitForThread(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CallingUnregisterOnAutomaticallyUnregisteredHandleReturnsTrue() { var waitCallbackInvoked = new AutoResetEvent(false); @@ -459,7 +459,7 @@ public static void CallingUnregisterOnAutomaticallyUnregisteredHandleReturnsTrue Assert.True(registeredWaitHandle.Unregister(null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void EventSetAfterUnregisterNotObservedOnWaitThread() { var waitEvent = new AutoResetEvent(false); @@ -471,7 +471,7 @@ public static void EventSetAfterUnregisterNotObservedOnWaitThread() waitEvent.CheckedWait(); // signal should not have been observed by wait thread } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CanDisposeEventAfterNonblockingUnregister() { using (var waitEvent = new AutoResetEvent(false)) @@ -482,7 +482,7 @@ public static void CanDisposeEventAfterNonblockingUnregister() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void MultipleRegisteredWaitsUnregisterHandleShiftTest() { var handlePendingRemoval = new AutoResetEvent(false); diff --git a/src/libraries/System.Threading/tests/AutoResetEventTests.cs b/src/libraries/System.Threading/tests/AutoResetEventTests.cs index e79a5719664acc..4e498e2374d013 100644 --- a/src/libraries/System.Threading/tests/AutoResetEventTests.cs +++ b/src/libraries/System.Threading/tests/AutoResetEventTests.cs @@ -172,7 +172,7 @@ public void WaitHandleWaitAny_Invalid() Assert.Throws(() => WaitHandle.WaitAny(null, TimeSpan.Zero)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void WaitHandleWaitAll() { AutoResetEvent[] handles = new AutoResetEvent[10]; @@ -190,7 +190,7 @@ public void WaitHandleWaitAll() Assert.False(Task.Run(() => WaitHandle.WaitAll(handles, 0)).Result); // Task.Run used to ensure MTA thread (necessary for desktop) } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void WaitHandleWaitAny() { AutoResetEvent[] handles = new AutoResetEvent[10]; @@ -204,7 +204,7 @@ public void WaitHandleWaitAny() Assert.Equal(WaitHandle.WaitTimeout, WaitHandle.WaitAny(handles, 0)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void PingPong() { using (AutoResetEvent are1 = new AutoResetEvent(true), are2 = new AutoResetEvent(false)) diff --git a/src/libraries/System.Threading/tests/BarrierCancellationTests.cs b/src/libraries/System.Threading/tests/BarrierCancellationTests.cs index f13917b09a82bf..16acd8ef85c040 100644 --- a/src/libraries/System.Threading/tests/BarrierCancellationTests.cs +++ b/src/libraries/System.Threading/tests/BarrierCancellationTests.cs @@ -8,7 +8,7 @@ namespace System.Threading.Tests { public static class BarrierCancellationTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void BarrierCancellationTestsCancelBeforeWait() { Barrier barrier = new Barrier(3); @@ -30,7 +30,7 @@ public static void BarrierCancellationTestsCancelBeforeWait() barrier.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void BarrierCancellationTestsCancelAfterWait_Negative() { CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); diff --git a/src/libraries/System.Threading/tests/BarrierTests.cs b/src/libraries/System.Threading/tests/BarrierTests.cs index c6b8640cb58d29..84e7f316e87b3d 100644 --- a/src/libraries/System.Threading/tests/BarrierTests.cs +++ b/src/libraries/System.Threading/tests/BarrierTests.cs @@ -50,7 +50,7 @@ private static void RunBarrierTest1_ctor(int initialCount, Type exceptionType) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunBarrierSignalAndWaitTests() { RunBarrierTest2_SignalAndWait(1, new TimeSpan(0, 0, 0, 0, -1), true, null); @@ -150,7 +150,7 @@ public static void RemovingParticipants() Assert.Throws(() => b.RemoveParticipants(2)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static async Task RemovingWaitingParticipants() { Barrier b = new Barrier(4); @@ -260,7 +260,7 @@ public static void SignalBarrierWithoutParticipants() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunBarrierTest7a() { for (int j = 0; j < 100; j++) @@ -291,7 +291,7 @@ public static void RunBarrierTest7a() /// Test the case when the post phase action throws an exception /// /// True if the test succeeded, false otherwise - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunBarrierTest8_PostPhaseException() { bool shouldThrow = true; @@ -371,7 +371,7 @@ public static void RunBarrierTest9_PostPhaseException() EnsurePostPhaseThrew(barrier); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void RunBarrierTest10a() { @@ -399,7 +399,7 @@ public static void RunBarrierTest10a() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunBarrierTest10b() { // Regression test for Barrier race condition @@ -420,7 +420,7 @@ public static void RunBarrierTest10b() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunBarrierTest10c() { for (int j = 0; j < 10; j++) diff --git a/src/libraries/System.Threading/tests/CountdownEventCancellationTests.cs b/src/libraries/System.Threading/tests/CountdownEventCancellationTests.cs index 865508b6eb47ea..d98439f873b8ff 100644 --- a/src/libraries/System.Threading/tests/CountdownEventCancellationTests.cs +++ b/src/libraries/System.Threading/tests/CountdownEventCancellationTests.cs @@ -8,7 +8,7 @@ namespace System.Threading.Tests { public static class CountdownEventCancellationTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancelBeforeWait() { CountdownEvent countdownEvent = new CountdownEvent(2); diff --git a/src/libraries/System.Threading/tests/CountdownEventTests.cs b/src/libraries/System.Threading/tests/CountdownEventTests.cs index 7c9603f2af03ce..d2922586cb56da 100644 --- a/src/libraries/System.Threading/tests/CountdownEventTests.cs +++ b/src/libraries/System.Threading/tests/CountdownEventTests.cs @@ -59,7 +59,7 @@ public static void RunCountdownEventTest0_StateTrans(int initCount, int increms, Assert.Equal(ev.InitialCount, ev.CurrentCount); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(0)] [InlineData(100)] public static void RunCountdownEventTest1_SimpleTimeout(int ms) diff --git a/src/libraries/System.Threading/tests/InterlockedTests.cs b/src/libraries/System.Threading/tests/InterlockedTests.cs index b9f61749c80bf5..9afb217fa9a43d 100644 --- a/src/libraries/System.Threading/tests/InterlockedTests.cs +++ b/src/libraries/System.Threading/tests/InterlockedTests.cs @@ -790,7 +790,7 @@ public void MemoryBarrierIntrinsic() MemoryBarrierPointer()(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void MemoryBarrierProcessWide() { // Stress MemoryBarrierProcessWide correctness using a simple AsymmetricLock diff --git a/src/libraries/System.Threading/tests/LockTests.cs b/src/libraries/System.Threading/tests/LockTests.cs index b4eab8787c8cac..8e04e311abc544 100644 --- a/src/libraries/System.Threading/tests/LockTests.cs +++ b/src/libraries/System.Threading/tests/LockTests.cs @@ -67,7 +67,7 @@ public static void IsHeldByCurrentThread() Assert.False(lockObj.IsHeldByCurrentThread); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void IsHeldByCurrentThread_WhenHeldBySomeoneElse() { Lock lockObj = new(); @@ -98,7 +98,7 @@ public static void Exit_Invalid() default(Lock.Scope).Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void Exit_WhenHeldBySomeoneElse_ThrowsSynchronizationLockException() { Lock lockObj = new(); @@ -155,7 +155,7 @@ public static void TryEnter_Invalid() () => lockObj.TryEnter(TimeSpan.FromMilliseconds((double)int.MaxValue + 1))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void Enter_HasToWait() { Lock lockObj = new(); @@ -257,7 +257,7 @@ public static void Enter_HasToWait() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void Enter_HasToWait_LockContentionCountTest() { long initialLockContentionCount = Monitor.LockContentionCount; @@ -265,7 +265,7 @@ public static void Enter_HasToWait_LockContentionCountTest() Assert.True(Monitor.LockContentionCount - initialLockContentionCount >= 2); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [ActiveIssue("https://github.com/dotnet/runtime/issues/49521", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public static void InterruptWaitTest() diff --git a/src/libraries/System.Threading/tests/ManualResetEventSlimCancellationTests.cs b/src/libraries/System.Threading/tests/ManualResetEventSlimCancellationTests.cs index a37208cd3376cd..aba199bee43b26 100644 --- a/src/libraries/System.Threading/tests/ManualResetEventSlimCancellationTests.cs +++ b/src/libraries/System.Threading/tests/ManualResetEventSlimCancellationTests.cs @@ -8,7 +8,7 @@ namespace System.Threading.Tests { public static class ManualResetEventCancellationTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancelBeforeWait() { ManualResetEventSlim mres = new ManualResetEventSlim(); @@ -25,7 +25,7 @@ public static void CancelBeforeWait() mres.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancelAfterWait() { CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); diff --git a/src/libraries/System.Threading/tests/ManualResetEventSlimTests.cs b/src/libraries/System.Threading/tests/ManualResetEventSlimTests.cs index 11e84d146edb3a..606dd8f9663024 100644 --- a/src/libraries/System.Threading/tests/ManualResetEventSlimTests.cs +++ b/src/libraries/System.Threading/tests/ManualResetEventSlimTests.cs @@ -29,7 +29,7 @@ public static void RunManualResetEventSlimTest0_StateTrans(bool init) } // Uses 3 events to coordinate between two threads. Very little validation. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunManualResetEventSlimTest1_SimpleWait() { ManualResetEventSlim ev1 = new ManualResetEventSlim(false); @@ -50,7 +50,7 @@ public static void RunManualResetEventSlimTest1_SimpleWait() } // Tests timeout on an event that is never set. - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunManualResetEventSlimTest2_TimeoutWait() { for (int i = 0; i < 2; i++) diff --git a/src/libraries/System.Threading/tests/ManualResetEventTests.cs b/src/libraries/System.Threading/tests/ManualResetEventTests.cs index d75930ae5d3b35..b99b967fc1af24 100644 --- a/src/libraries/System.Threading/tests/ManualResetEventTests.cs +++ b/src/libraries/System.Threading/tests/ManualResetEventTests.cs @@ -115,7 +115,7 @@ public void MultiWaitWithAllIndexesResetTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void WaitHandleWaitAll() { ManualResetEvent[] handles = new ManualResetEvent[10]; @@ -133,7 +133,7 @@ public void WaitHandleWaitAll() Assert.True(Task.Run(() => WaitHandle.WaitAll(handles, 0)).Result); // Task.Run used to ensure MTA thread (necessary for desktop) } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void WaitHandleWaitAny() { ManualResetEvent[] handles = new ManualResetEvent[10]; @@ -147,7 +147,7 @@ public void WaitHandleWaitAny() Assert.Equal(5, WaitHandle.WaitAny(handles, 0)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void PingPong() { using (ManualResetEvent mre1 = new ManualResetEvent(true), mre2 = new ManualResetEvent(false)) diff --git a/src/libraries/System.Threading/tests/MonitorTests.cs b/src/libraries/System.Threading/tests/MonitorTests.cs index 13cb675cef34ae..b1be37eb63146b 100644 --- a/src/libraries/System.Threading/tests/MonitorTests.cs +++ b/src/libraries/System.Threading/tests/MonitorTests.cs @@ -64,7 +64,7 @@ public static void IsEntered() Assert.False(Monitor.IsEntered(obj)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void IsEntered_WhenHeldBySomeoneElse() { var obj = new object(); @@ -126,7 +126,7 @@ public static void Exit_Invalid() Assert.Throws(() => Monitor.Exit(valueType)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void Exit_WhenHeldBySomeoneElse_ThrowsSynchronizationLockException() { var obj = new object(); @@ -215,7 +215,7 @@ public static void TryEnter_Invalid() AssertExtensions.Throws("lockTaken", () => Monitor.TryEnter(obj, TimeSpan.Zero, ref lockTaken)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void Enter_HasToWait() { var thinLock = new object(); @@ -397,7 +397,7 @@ public static void Enter_HasToWait() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void Wait_Invalid() { var obj = new object(); @@ -413,7 +413,7 @@ public static void Wait_Invalid() () => Monitor.Wait(obj, TimeSpan.FromMilliseconds((double)int.MaxValue + 1))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void WaitTest() { var obj = new object(); @@ -450,7 +450,7 @@ public static void WaitTest() t.Join(500); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void Enter_HasToWait_LockContentionCountTest() { long initialLockContentionCount = Monitor.LockContentionCount; @@ -458,7 +458,7 @@ public static void Enter_HasToWait_LockContentionCountTest() Assert.True(Monitor.LockContentionCount - initialLockContentionCount >= 2); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ObjectHeaderSyncBlockTransitionTryEnterRaceTest() { var threadStarted = new AutoResetEvent(false); @@ -488,7 +488,7 @@ public static void ObjectHeaderSyncBlockTransitionTryEnterRaceTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [ActiveIssue("https://github.com/dotnet/runtime/issues/49521", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [ActiveIssue("https://github.com/dotnet/runtime/issues/87718", TestRuntimes.Mono)] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] diff --git a/src/libraries/System.Threading/tests/MutexTests.cs b/src/libraries/System.Threading/tests/MutexTests.cs index 6b06baeb760344..e646d0f8710a7c 100644 --- a/src/libraries/System.Threading/tests/MutexTests.cs +++ b/src/libraries/System.Threading/tests/MutexTests.cs @@ -201,7 +201,7 @@ public void MultiWaitWithAllIndexesLockedTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void MutualExclusionTest() { var threadLocked = new AutoResetEvent(false); @@ -285,7 +285,7 @@ public void Ctor_TryCreateGlobalMutexTest_Uwp() Assert.Throws(() => new Mutex(false, $"Global\\{Guid.NewGuid():N}"))); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(GetValidNames))] public void OpenExisting(string name) { @@ -420,7 +420,7 @@ public static IEnumerable AbandonExisting_MemberData() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [MemberData(nameof(AbandonExisting_MemberData))] public void AbandonExisting( string name, @@ -660,7 +660,7 @@ private static void IncrementValueInFileNTimes(Mutex mutex, string fileName, int } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void NamedMutex_ThreadExitDisposeRaceTest() { var mutexName = Guid.NewGuid().ToString("N"); @@ -720,7 +720,7 @@ public void NamedMutex_ThreadExitDisposeRaceTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void NamedMutex_DisposeWhenLockedRaceTest() { var mutexName = Guid.NewGuid().ToString("N"); diff --git a/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs b/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs index bf4fdd72cc6fdd..f6ef865a692891 100644 --- a/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs +++ b/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs @@ -60,7 +60,7 @@ public static void Dispose() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void EnterExit() { using (ReaderWriterLockSlim rwls = new ReaderWriterLockSlim()) @@ -176,7 +176,7 @@ public static void DeadlockAvoidance() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(LockRecursionPolicy.NoRecursion)] [InlineData(LockRecursionPolicy.SupportsRecursion)] public static void InvalidExits(LockRecursionPolicy policy) @@ -236,7 +236,7 @@ public static void InvalidTimeouts() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void WritersAreMutuallyExclusiveFromReaders() { using (Barrier barrier = new Barrier(2)) @@ -261,7 +261,7 @@ public static void WritersAreMutuallyExclusiveFromReaders() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void WritersAreMutuallyExclusiveFromWriters() { using (Barrier barrier = new Barrier(2)) @@ -286,7 +286,7 @@ public static void WritersAreMutuallyExclusiveFromWriters() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ReadersMayBeConcurrent() { using (Barrier barrier = new Barrier(2)) @@ -320,7 +320,7 @@ public static void ReadersMayBeConcurrent() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void WriterToWriterChain() { using (AutoResetEvent are = new AutoResetEvent(false)) @@ -340,7 +340,7 @@ public static void WriterToWriterChain() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void WriterToReaderChain() { using (AutoResetEvent are = new AutoResetEvent(false)) @@ -360,7 +360,7 @@ public static void WriterToReaderChain() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void WriterToUpgradeableReaderChain() { using (AutoResetEvent are = new AutoResetEvent(false)) @@ -380,7 +380,7 @@ public static void WriterToUpgradeableReaderChain() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void ReleaseReadersWhenWaitingWriterTimesOut() { @@ -451,7 +451,7 @@ public static void ReleaseReadersWhenWaitingWriterTimesOut() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [OuterLoop] public static void DontReleaseWaitingReadersWhenThereAreWaitingWriters() { diff --git a/src/libraries/System.Threading/tests/ReaderWriterLockTests.cs b/src/libraries/System.Threading/tests/ReaderWriterLockTests.cs index 3ee587edc6318c..c930b216b14b1d 100644 --- a/src/libraries/System.Threading/tests/ReaderWriterLockTests.cs +++ b/src/libraries/System.Threading/tests/ReaderWriterLockTests.cs @@ -86,7 +86,7 @@ public static void ShouldNotBeOwnerForRestoreLockTest() trwl.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void InvalidLockCookieTest() { // Invalid lock cookie created by using one up with Upgrade/Downgrade @@ -121,7 +121,7 @@ public static void InvalidLockCookieTest() trwl.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void BasicLockTest() { var trwl = new TestReaderWriterLock(); @@ -498,7 +498,7 @@ public static void DowngradeQuirks_ChangedInDotNetCore() trwl.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void WaitingReadersTest() { var trwl = new TestReaderWriterLock(); @@ -528,7 +528,7 @@ public static void WaitingReadersTest() trwl.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void WaitingWritersTest() { var trwl = new TestReaderWriterLock(); @@ -559,7 +559,7 @@ public static void WaitingWritersTest() trwl.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ReadersWaitingOnWaitingWriterTest() { var trwl = new TestReaderWriterLock(); @@ -609,7 +609,7 @@ public static void ReadersWaitingOnWaitingWriterTest() trwl.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void ReadersWaitingOnWaitingUpgraderTest() { var trwl = new TestReaderWriterLock(); @@ -662,7 +662,7 @@ public static void ReadersWaitingOnWaitingUpgraderTest() trwl.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void WaitingUpgradersTest() { var trwl = new TestReaderWriterLock(); @@ -707,7 +707,7 @@ public static void WaitingUpgradersTest() trwl.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void AtomicRecursiveReaderTest() { var trwl = new TestReaderWriterLock(); @@ -733,7 +733,7 @@ public static void AtomicRecursiveReaderTest() trwl.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void AtomicDowngradeTest() { var trwl = new TestReaderWriterLock(); diff --git a/src/libraries/System.Threading/tests/SemaphoreSlimCancellationTests.cs b/src/libraries/System.Threading/tests/SemaphoreSlimCancellationTests.cs index 91f2a1ff079f45..f469b79a0f35ef 100644 --- a/src/libraries/System.Threading/tests/SemaphoreSlimCancellationTests.cs +++ b/src/libraries/System.Threading/tests/SemaphoreSlimCancellationTests.cs @@ -8,7 +8,7 @@ namespace System.Threading.Tests { public static class SemaphoreSlimCancellationTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancelBeforeWait() { SemaphoreSlim semaphoreSlim = new SemaphoreSlim(2); @@ -25,7 +25,7 @@ public static void CancelBeforeWait() semaphoreSlim.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void CancelAfterWait() { CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); @@ -49,7 +49,7 @@ public static void CancelAfterWait() // currently we don't expose this.. but it was verified manually } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(false)] [InlineData(true)] public static async Task Cancel_WaitAsync_ContinuationInvokedAsynchronously(bool withTimeout) diff --git a/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs b/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs index 7aabd01c39f1e2..98ba4a52fd63be 100644 --- a/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs +++ b/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs @@ -44,7 +44,7 @@ public static void RunSemaphoreSlimTest0_Ctor_Negative() RunSemaphoreSlimTest0_Helper(-1, 10, typeof(ArgumentOutOfRangeException)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunSemaphoreSlimTest1_Wait() { // Infinite timeout @@ -62,7 +62,7 @@ public static void RunSemaphoreSlimTest1_Wait() RunSemaphoreSlimTest1_Wait_Helper(0, 10, 10, false, null); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunSemaphoreSlimTest1_Wait_NegativeCases() { // Invalid timeout @@ -71,7 +71,7 @@ public static void RunSemaphoreSlimTest1_Wait_NegativeCases() (10, 10, new TimeSpan(0, 0, int.MaxValue), true, typeof(ArgumentOutOfRangeException)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunSemaphoreSlimTest1_WaitAsync() { // Infinite timeout @@ -89,7 +89,7 @@ public static void RunSemaphoreSlimTest1_WaitAsync() RunSemaphoreSlimTest1_WaitAsync_Helper(0, 10, 10, false, null); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunSemaphoreSlimTest1_WaitAsync_NegativeCases() { // Invalid timeout @@ -136,7 +136,7 @@ public static void RunSemaphoreSlimTest4_Dispose() (5, 10, SemaphoreSlimActions.AvailableWaitHandle, typeof(ObjectDisposedException)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunSemaphoreSlimTest5_CurrentCount() { RunSemaphoreSlimTest5_CurrentCount_Helper(5, 10, null); @@ -145,7 +145,7 @@ public static void RunSemaphoreSlimTest5_CurrentCount() RunSemaphoreSlimTest5_CurrentCount_Helper(5, 10, SemaphoreSlimActions.Release); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunSemaphoreSlimTest7_AvailableWaitHandle() { RunSemaphoreSlimTest7_AvailableWaitHandle_Helper(5, 10, null, true); @@ -461,7 +461,7 @@ private static void RunSemaphoreSlimTest7_AvailableWaitHandle_Helper(int initial /// Number of failed wait threads /// The final semaphore count /// True if the test succeeded, false otherwise - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(5, 1000, 50, 50, 50, 0, 5, 1000)] [InlineData(0, 1000, 50, 25, 25, 25, 0, 500)] [InlineData(0, 1000, 50, 0, 0, 50, 0, 100)] @@ -527,7 +527,7 @@ public static void RunSemaphoreSlimTest8_ConcWaitAndRelease(int initial, int max /// Number of failed wait threads /// The final semaphore count /// True if the test succeeded, false otherwise - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(5, 1000, 50, 50, 50, 0, 5, 500)] [InlineData(0, 1000, 50, 25, 25, 25, 0, 500)] [InlineData(0, 1000, 50, 0, 0, 50, 0, 100)] @@ -576,7 +576,7 @@ public static void RunSemaphoreSlimTest8_ConcWaitAsyncAndRelease(int initial, in Assert.Equal(finalCount, semaphore.CurrentCount); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(10, 10)] [InlineData(1, 10)] [InlineData(10, 1)] diff --git a/src/libraries/System.Threading/tests/SemaphoreTests.cs b/src/libraries/System.Threading/tests/SemaphoreTests.cs index 200728cfb9406f..550b76addf0af0 100644 --- a/src/libraries/System.Threading/tests/SemaphoreTests.cs +++ b/src/libraries/System.Threading/tests/SemaphoreTests.cs @@ -277,7 +277,7 @@ public void CanWaitWithoutBlockingForReleasedCount() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [ActiveIssue("https://github.com/dotnet/runtime/issues/49890", TestPlatforms.Android)] public void AnonymousProducerConsumer() { diff --git a/src/libraries/System.Threading/tests/SpinLockTests.cs b/src/libraries/System.Threading/tests/SpinLockTests.cs index 5b027b32a58430..9016a576474faf 100644 --- a/src/libraries/System.Threading/tests/SpinLockTests.cs +++ b/src/libraries/System.Threading/tests/SpinLockTests.cs @@ -12,7 +12,7 @@ namespace System.Threading.Tests /// public class SpinLockTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void EnterExit() { var sl = new SpinLock(); @@ -69,7 +69,7 @@ public static void RunSpinLockTests_NegativeTests() /// Number of threads that call enter/exit /// True if succeeded, false otherwise [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(2, false)] [InlineData(128, false)] [InlineData(256, false)] @@ -139,7 +139,7 @@ public static void RunSpinLockTest0_Enter(int threadsCount, bool enableThreadIDs /// Number of threads that call enter/exit /// True if succeeded, false otherwise [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(2, false)] [InlineData(128, false)] [InlineData(256, false)] diff --git a/src/libraries/System.Threading/tests/SynchronizationContextTests.cs b/src/libraries/System.Threading/tests/SynchronizationContextTests.cs index 3872ae8254e4ab..87ab6949e77fd7 100644 --- a/src/libraries/System.Threading/tests/SynchronizationContextTests.cs +++ b/src/libraries/System.Threading/tests/SynchronizationContextTests.cs @@ -8,7 +8,7 @@ namespace System.Threading.Tests { public static class SynchronizationContextTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void WaitTest() { var tsc = new TestSynchronizationContext(); diff --git a/src/libraries/System.Threading/tests/System.Threading.Tests.csproj b/src/libraries/System.Threading/tests/System.Threading.Tests.csproj index e938db9863da3d..aba8bc283a2ab2 100644 --- a/src/libraries/System.Threading/tests/System.Threading.Tests.csproj +++ b/src/libraries/System.Threading/tests/System.Threading.Tests.csproj @@ -6,6 +6,7 @@ true true + true diff --git a/src/libraries/System.Threading/tests/ThreadLocalTests.cs b/src/libraries/System.Threading/tests/ThreadLocalTests.cs index 1327d768e1babf..10f805f090a5fd 100644 --- a/src/libraries/System.Threading/tests/ThreadLocalTests.cs +++ b/src/libraries/System.Threading/tests/ThreadLocalTests.cs @@ -59,7 +59,7 @@ public static void RunThreadLocalTest3_IsValueCreated() Assert.True(tlocal.IsValueCreated); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public static void RunThreadLocalTest4_Value() { ThreadLocal tlocal = null; diff --git a/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs b/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs index ffe5ea9adb7e3e..0f00852721194d 100644 --- a/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs +++ b/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs @@ -434,7 +434,7 @@ public void AsyncTSTest(int variation) }, variation.ToString()).Dispose(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(true, false, null)] [InlineData(true, true, null)] public void AsyncTSAndDependantClone(bool requiresNew, bool synchronizeScope, string txId) @@ -524,7 +524,7 @@ public void AsyncTSAndDependantClone(bool requiresNew, bool synchronizeScope, st AssertTransaction(txId); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(true, false, null)] [InlineData(true, true, null)] public void NestedAsyncTSAndDependantClone(bool parentrequiresNew, bool childRequiresNew, string txId) @@ -1106,7 +1106,7 @@ public void VerifyBYOT(TransactionScopeAsyncFlowOption asyncFlowOption) AssertTransactionNull(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public void VerifyBYOTOpenConnSimulationTest() { // Create threads to do work @@ -1123,7 +1123,7 @@ public void VerifyBYOTOpenConnSimulationTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/97513", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/97513", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] public async Task VerifyBYOTSyncTSNestedAsync() { string txId1; @@ -1174,7 +1174,7 @@ public async Task VerifyBYOTAsyncTSNestedAsync() AssertTransactionNull(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(TransactionScopeAsyncFlowOption.Suppress)] [InlineData(TransactionScopeAsyncFlowOption.Enabled)] public void DoTxQueueWorkItem(TransactionScopeAsyncFlowOption asyncFlowOption) @@ -1210,7 +1210,7 @@ public void DoTxQueueWorkItem(TransactionScopeAsyncFlowOption asyncFlowOption) AssertTransactionNull(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(TransactionScopeAsyncFlowOption.Suppress)] [InlineData(TransactionScopeAsyncFlowOption.Enabled)] public void DoTxNewThread(TransactionScopeAsyncFlowOption asyncFlowOption) diff --git a/src/libraries/System.Transactions.Local/tests/LTMEnlistmentTests.cs b/src/libraries/System.Transactions.Local/tests/LTMEnlistmentTests.cs index c686049d742b5a..040874ec690cf9 100644 --- a/src/libraries/System.Transactions.Local/tests/LTMEnlistmentTests.cs +++ b/src/libraries/System.Transactions.Local/tests/LTMEnlistmentTests.cs @@ -73,7 +73,7 @@ public void SinglePhaseDurable(int volatileCount, EnlistmentOptions volatileEnli Assert.Equal(expectedTxStatus, tx.TransactionInformation.Status); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(EnlistmentOptions.EnlistDuringPrepareRequired, Phase1Vote.Prepared, true, true, EnlistmentOutcome.Committed, TransactionStatus.Committed)] [InlineData(EnlistmentOptions.None, Phase1Vote.Prepared, false, true, EnlistmentOutcome.Committed, TransactionStatus.Committed)] public void EnlistDuringPhase0(EnlistmentOptions enlistmentOption, Phase1Vote phase1Vote, bool expectPhase0EnlistSuccess, bool commit, EnlistmentOutcome expectedOutcome, TransactionStatus expectedTxStatus) @@ -108,7 +108,7 @@ public void EnlistDuringPhase0(EnlistmentOptions enlistmentOption, Phase1Vote ph Assert.Equal(expectedTxStatus, tx.TransactionInformation.Status); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupportedAndBlockingWait))] [InlineData(5, EnlistmentOptions.None, Phase1Vote.Prepared, Phase1Vote.Prepared, true, EnlistmentOutcome.Committed, TransactionStatus.Committed)] [InlineData(5, EnlistmentOptions.None, Phase1Vote.Prepared, Phase1Vote.ForceRollback, true, EnlistmentOutcome.Aborted, TransactionStatus.Aborted)] public void EnlistVolatile(int volatileCount, EnlistmentOptions enlistmentOption, Phase1Vote volatilePhase1Vote, Phase1Vote lastPhase1Vote, bool commit, EnlistmentOutcome expectedEnlistmentOutcome, TransactionStatus expectedTxStatus) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 051d97504adf1e..138d478ec2ccb7 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -400,10 +400,6 @@ - - - - diff --git a/src/mono/browser/runtime/multi-threading.md b/src/mono/browser/runtime/multi-threading.md index 4e308852e50341..40896084fc5834 100644 --- a/src/mono/browser/runtime/multi-threading.md +++ b/src/mono/browser/runtime/multi-threading.md @@ -4,7 +4,9 @@ * Single-threaded mode as you know it since .Net 6 - default, safe, tested, supported - - from .Net 8 it could be easily started also as a web worker, but you need your own messaging between main and worker + - from .Net 8 single-threaded build could be easily started also as a web worker + - but you need your own messaging between UT and the dotnet running in the worker + - demo https://github.com/ilonatommy/reactWithDotnetOnWebWorker * `MainThreadingMode.DeputyThread` + `JSThreadBlockingMode.NoBlockingWait` + `JSThreadInteropMode.SimpleSynchronousJSInterop` + **default threading**, safe, tested, supported + blocking `.Wait` is allowed on thread pool and new threads @@ -14,13 +16,14 @@ * `MainThreadingMode.DeputyThread` + `JSThreadBlockingMode.AllowBlockingWait` + `JSThreadInteropMode.SimpleSynchronousJSInterop` + pragmatic for legacy codebase, which contains blocking code and can't be fully executed on thread pool or new threads - - ** could cause deadlocks !!!** + - **could cause deadlocks !!!** - Use your own judgment before you opt in. - - blocking .Wait is allowed on all threads! - - blocking .Wait on pending JS `Task`/`Promise` (like HTTP/WS requests) could cause deadlocks! + - blocking `.Wait` is allowed on all threads! + - blocking `.Wait` on pending JS `Task`/`Promise` (like HTTP/WS requests) could cause deadlocks! - reason is that blocked thread can't process the browser event loop - so it can't resolve the promises - even when it's longer `Promise`/`Task` chain + - on other platforms, I/O typically doesn't have thread affinity. Browser is more prone to deadlock. - DOM events like `onClick` need to be asynchronous, if the handler needs use synchronous `[JSImport]` - synchronous calls to `[JSImport]`/`[JSExport]` can't synchronously call back @@ -33,13 +36,14 @@ - not recommended, not tested, not supported! - can deadlock on creating new threads - can deadlock on blocking `.Wait` for a pending JS `Promise`/`Task`, including HTTP/WS requests - - .Wait is spin-waiting - it blocks debugger, network, UI rendering, ... + - `.Wait` is spin-waiting in the UI thread - it blocks debugger, network, UI rendering, ... + JS interop to UI is faster, synchronous and re-entrant -### There could be more JSThreadInteropModes: +### There could be more modes: - allow re-entrant synchronous JS interop on `JSWebWorker`. - This is possible because managed code is running on same thread as JS. - But it's nuanced to debug it, when things go wrong. + - The model breaks when `JSObject`s with affinity to multiple `JSWebWorker`s is used in chain of synchronous calls dispatched to multiple threads. - allow re-entrant synchronous JS interop also on deputy thread. - This is not possible for deputy, because it would deadlock on call back to different thread. - The thread receiving the callback is still blocked waiting for the first synchronous call to finish. diff --git a/src/mono/browser/test-main.js b/src/mono/browser/test-main.js index 3aacd8e2c67d68..49c92f06da185b 100644 --- a/src/mono/browser/test-main.js +++ b/src/mono/browser/test-main.js @@ -135,6 +135,8 @@ function processArguments(incomingArguments, runArgs) { runArgs.runtimeArgs.push(arg); } else if (currentArg == "--disable-on-demand-gc") { runArgs.enableGC = false; + } else if (currentArg == "--allow-blocking-wait") { + runArgs.allowBlockingWait = true; } else if (currentArg == "--diagnostic-tracing") { runArgs.diagnosticTracing = true; } else if (currentArg.startsWith("--working-dir=")) { @@ -254,7 +256,6 @@ function configureRuntime(dotnet, runArgs) { .withConfig({ loadAllSatelliteResources: true }); - if (ENVIRONMENT_IS_NODE) { dotnet .withEnvironmentVariable("NodeJSPlatform", process.platform) @@ -276,6 +277,11 @@ function configureRuntime(dotnet, runArgs) { // dotnet.withEnvironmentVariable("DOTNET_DebugWriteToStdErr", "1") if (ENVIRONMENT_IS_WEB) { + if (runArgs.allowBlockingWait) { + dotnet.withConfig({ + jsThreadBlockingMode: 100 /* JSThreadBlockingMode.AllowBlockingWait */ + }); + } if (runArgs.interpreterPgo) dotnet.withInterpreterPgo(true); dotnet.withEnvironmentVariable("IsWebSocketSupported", "true");