diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs index 338af221779cbf..f4348e33595760 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs @@ -145,7 +145,7 @@ private void StartCallback() /// public static void SpinWait(int iterations) { - if (Thread.IsSingleThreaded) return; + if (!RuntimeFeature.IsMultithreadingSupported) return; if (iterations < SpinWaitCoopThreshold) { diff --git a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs index 49e3298265edd9..9a3f3c6be36e06 100644 --- a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs +++ b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs @@ -1173,7 +1173,7 @@ public virtual async Task Flush_MultipleTimes_Idempotent(ReadWriteMode mode) await FlushAsync(mode, stream); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public virtual async Task Flush_SetLengthAtEndOfBuffer_OperatesOnValidData() { if (!CanSeek || !CanSetLengthGreaterThanCapacity) @@ -1734,7 +1734,7 @@ public virtual async Task ReadAsync_CancelPendingValueTask_ThrowsCancellationExc await ValidateCancelableReadAsyncValueTask_AfterInvocation_ThrowsCancellationException(readable, cancellationDelay); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadWriteByte_Success() @@ -1919,7 +1919,7 @@ public virtual async Task ReadWrite_MessagesSmallerThanReadBuffer_Success(ReadWr } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(AllReadWriteModesAndValue), false)] [MemberData(nameof(AllReadWriteModesAndValue), true)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] @@ -2400,7 +2400,7 @@ public virtual async Task ZeroByteWrite_OtherDataReceivedSuccessfully(ReadWriteM await writes; } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] @@ -2519,13 +2519,13 @@ public static IEnumerable CopyToAsync_AllDataCopied_MemberData() => [OuterLoop("May take several seconds", ~TestPlatforms.Browser)] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on browser")] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public virtual async Task CopyToAsync_AllDataCopied_Large(bool useAsync) => await CopyToAsync_AllDataCopied(1024 * 1024, useAsync); - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(CopyToAsync_AllDataCopied_MemberData))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] @@ -2564,7 +2564,7 @@ public virtual async Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync } [OuterLoop("May take several seconds")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task Parallel_ReadWriteMultipleStreamsConcurrently() @@ -2730,7 +2730,7 @@ public virtual async Task ClosedConnection_WritesFailImmediately_ThrowException( await Assert.ThrowsAsync(async () => { await Task.Factory.FromAsync(writeable.BeginWrite, writeable.EndWrite, new byte[1], 0, 1, null); }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public virtual async Task ReadAsync_DuringReadAsync_ThrowsIfUnsupported() diff --git a/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs b/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs index 450e2259fee1f5..9ac24cbf6da26f 100644 --- a/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs +++ b/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs @@ -65,7 +65,7 @@ public void EmptyData_RoundTrips() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public virtual void FlushAsync_DuringWriteAsync() { byte[] buffer = new byte[100000]; @@ -98,7 +98,7 @@ public virtual void FlushAsync_DuringWriteAsync() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task FlushAsync_DuringReadAsync() { byte[] buffer = new byte[32]; @@ -125,7 +125,7 @@ public async Task FlushAsync_DuringReadAsync() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task FlushAsync_DuringFlushAsync() { byte[] buffer = null; @@ -166,7 +166,7 @@ public async Task FlushAsync_DuringFlushAsync() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public virtual async Task Dispose_WithUnfinishedReadAsync() { string compressedPath = CompressedTestFile(UncompressedTestFile()); diff --git a/src/libraries/Common/tests/System/TimeProviderTests.cs b/src/libraries/Common/tests/System/TimeProviderTests.cs index e0840f09d1cdbb..0385454a826402 100644 --- a/src/libraries/Common/tests/System/TimeProviderTests.cs +++ b/src/libraries/Common/tests/System/TimeProviderTests.cs @@ -108,7 +108,7 @@ public static IEnumerable TimersProvidersData() yield return new object[] { new FastClock(), 600 }; // At least 4-periods of of 150ms. fast clock cut time by half } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(TimersProvidersData))] public void TestProviderTimer(TimeProvider provider, int minMilliseconds) { @@ -213,7 +213,7 @@ private static void CancelAfter(TimeProvider provider, CancellationTokenSource c } #endif // NETFRAMEWORK - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(TimersProvidersListData))] public static void CancellationTokenSourceWithTimer(TimeProvider provider) { @@ -294,7 +294,7 @@ public static void CancellationTokenSourceWithTimer(TimeProvider provider) cts.Dispose(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(TimersProvidersWithTaskFactorData))] public static void RunDelayTests(TimeProvider provider, ITestTaskFactory taskFactory) { @@ -333,7 +333,7 @@ public static void RunDelayTests(TimeProvider provider, ITestTaskFactory taskFac Assert.False(task4.IsCompleted, "RunDelayTests: > FAILED. Delay(10000) appears to have completed too soon(2)."); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(TimersProvidersWithTaskFactorData))] public static async Task RunWaitAsyncTests(TimeProvider provider, ITestTaskFactory taskFactory) { @@ -396,7 +396,7 @@ public static async Task RunWaitAsyncTests(TimeProvider provider, ITestTaskFacto } #if !NETFRAMEWORK - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(TimersProvidersListData))] public static async Task PeriodicTimerTests(TimeProvider provider) { @@ -662,7 +662,7 @@ public static IEnumerable TaskFactoryData() #endif // TESTEXTENSIONS } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(TaskFactoryData))] public async Task TestDelayTaskContinuation(ITestTaskFactory taskFactory) { diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 8c8968d54bf7de..4b5ae6e0b48bbc 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -139,9 +139,12 @@ public static int SlowRuntimeTimeoutModifier public static bool FileCreateCaseSensitive => IsCaseSensitiveOS; #endif - public static bool IsThreadingSupported => (!IsWasi && !IsBrowser) || IsWasmThreadingSupported; - public static bool IsWasmThreadingSupported => IsBrowser && IsEnvironmentVariableTrue("IsBrowserThreadingSupported"); - public static bool IsNotWasmThreadingSupported => !IsWasmThreadingSupported; +#if NET && TARGETS_NET11_OR_GREATER + public static bool IsMultithreadingSupported => RuntimeFeature.IsMultithreadingSupported; +#else + public static bool IsMultithreadingSupported => (IsNotBrowser && IsNotWasi) || IsEnvironmentVariableTrue("IsBrowserThreadingSupported"); +#endif + public static bool IsNotMultithreadingSupported => !IsMultithreadingSupported; private static readonly Lazy s_isBinaryFormatterSupported = new Lazy(DetermineBinaryFormatterSupport); public static bool IsBinaryFormatterSupported => s_isBinaryFormatterSupported.Value; diff --git a/src/libraries/Common/tests/TestUtilities/TestUtilities.csproj b/src/libraries/Common/tests/TestUtilities/TestUtilities.csproj index e29f6f24e3633a..043bd69a9c0c36 100644 --- a/src/libraries/Common/tests/TestUtilities/TestUtilities.csproj +++ b/src/libraries/Common/tests/TestUtilities/TestUtilities.csproj @@ -5,6 +5,9 @@ false + + $(DefineConstants);TARGETS_NET11_OR_GREATER + ((IEnumerable)values)); // Call the generic IEnumerable-based overload } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] // mini-stress test that likely runs for several seconds public static void Concat_String_ConcurrencySafe() { diff --git a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/tests/EnvironmentVariablesTest.cs b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/tests/EnvironmentVariablesTest.cs index 000d39b843f63a..fab6c16675453a 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/tests/EnvironmentVariablesTest.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/tests/EnvironmentVariablesTest.cs @@ -283,7 +283,7 @@ public void AddEnvironmentVariablesUsingPrefixWithDoubleUnderscores_Bind_PrefixM } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void BindingDoesNotThrowIfReloadedDuringBinding() { var dic = new Dictionary diff --git a/src/libraries/Microsoft.Extensions.Configuration/tests/ConfigurationManagerTest.cs b/src/libraries/Microsoft.Extensions.Configuration/tests/ConfigurationManagerTest.cs index 0455727a1f848c..e84f51b2c457fb 100644 --- a/src/libraries/Microsoft.Extensions.Configuration/tests/ConfigurationManagerTest.cs +++ b/src/libraries/Microsoft.Extensions.Configuration/tests/ConfigurationManagerTest.cs @@ -173,7 +173,7 @@ public void DisposesProvidersOnRemoval() Assert.True(provider5.IsDisposed); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ProviderCanBlockLoadWaitingOnConcurrentRead() { using var mre = new ManualResetEventSlim(false); @@ -209,7 +209,7 @@ public static TheoryData> ConcurrentReadActions } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(ConcurrentReadActions))] public async Task ProviderDisposeDelayedWaitingOnConcurrentRead(Action concurrentReadAction) { diff --git a/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs b/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs index 721cdd008a8394..f6bbb5adc056e5 100644 --- a/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs +++ b/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs @@ -939,7 +939,7 @@ await WaitForChange( Assert.True(token.HasChanged); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void BindingDoesNotThrowIfReloadedDuringBinding() { WriteTestFiles(); 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 655fbe0c333017..c8ed86dd37cd3d 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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void CallSitesAreUniquePerServiceTypeAndSlot() { // Connected graph @@ -828,7 +828,7 @@ public void CallSitesAreUniquePerServiceTypeAndSlot() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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 2e837783951f7f..22b4e570ed42b2 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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void GetAsyncService_DisposeAsyncOnSameThread_ThrowsAndDoesNotHangAndDisposeAsyncGetsCalled() { // Arrange @@ -398,7 +398,7 @@ public void GetAsyncService_DisposeAsyncOnSameThread_ThrowsAndDoesNotHangAndDisp Assert.True(asyncDisposableResource.DisposeAsyncCalled, "!DisposeAsyncCalled"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void GetService_DisposeOnSameThread_ThrowsAndDoesNotHangAndDisposeGetsCalled() { // Arrange @@ -525,7 +525,7 @@ public InnerSingleton(ManualResetEvent mre1, ManualResetEvent mre2) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task GetRequiredService_ResolvingSameSingletonInTwoThreads_SameServiceReturned() { using (var mreForThread1 = new ManualResetEvent(false)) @@ -581,7 +581,7 @@ public async Task GetRequiredService_ResolvingSameSingletonInTwoThreads_SameServ } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task GetRequiredService_UsesSingletonAndLazyLocks_NoDeadlock() { using (var mreForThread1 = new ManualResetEvent(false)) @@ -669,7 +669,7 @@ public async Task GetRequiredService_UsesSingletonAndLazyLocks_NoDeadlock() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task GetRequiredService_BiggerObjectGraphWithOpenGenerics_NoDeadlock() { // Test is similar to GetRequiredService_UsesSingletonAndLazyLocks_NoDeadlock (but for open generics and a larger object graph) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs index cf1e6f7598a25c..a26b87fc72a159 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs @@ -1139,7 +1139,7 @@ public async Task TokenNotFiredForInvalidPathStartingWithSlash_Windows(string sl await TokenNotFiredForInvalidPathStartingWithSlash(slashes); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData("/\0/")] // Testing Unix specific behaviour on leading slashes. [PlatformSpecific(TestPlatforms.AnyUnix)] diff --git a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs index 3694d4da397a7a..de12ae7da78465 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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "ApplicationNameSetFromArgument")] public void ApplicationNameSetFromArgument() { @@ -280,7 +280,7 @@ public void ApplicationNameSetFromArgument() Assert.Equal("ApplicationNameSetFromArgument", configuration["applicationName"]); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))] public void NoSpecialEntryPointPatternCanRunInParallel() { diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/BackgroundServiceTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/BackgroundServiceTests.cs index 14766a617cbbc6..0f3ed60d8ab5d4 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/BackgroundServiceTests.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/BackgroundServiceTests.cs @@ -60,7 +60,7 @@ public async Task StopAsyncStopsBackgroundService() Assert.True(service.ExecuteTask.IsCompleted); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task StopAsyncStopsEvenIfTaskNeverEnds() { var service = new IgnoreCancellationService(); @@ -71,7 +71,7 @@ public async Task StopAsyncStopsEvenIfTaskNeverEnds() await service.StopAsync(cts.Token); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task StopAsyncThrowsIfCancellationCallbackThrows() { var service = new ThrowOnCancellationService(); diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs index abda9052dffd64..719373bbafd133 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs @@ -284,7 +284,7 @@ public void LastCallToUseEnvironmentWins(string environment) Assert.Equal(environment, hostEnv.EnvironmentName); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/48696")] public async Task CreateDefaultBuilder_ConfigJsonDoesNotReload() { diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs index 63cc94006ff4af..aa1997453818f2 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs @@ -252,7 +252,7 @@ public void Factory_CreateClient_FiltersCanDecorateBuilder() Assert.Same(expected[7], handler); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Factory_CreateClient_WithExpiry_CanExpire() { // Arrange @@ -295,7 +295,7 @@ public async Task Factory_CreateClient_WithExpiry_CanExpire() Assert.NotSame(activeEntry1.Handler, activeEntry2.Handler); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Factory_CreateClient_WithExpiry_HandlerCanBeReusedBeforeExpiry() { // Arrange @@ -344,7 +344,7 @@ public async Task Factory_CreateClient_WithExpiry_HandlerCanBeReusedBeforeExpiry Assert.NotSame(activeEntry1.Handler, activeEntry2.Handler); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsPreciseGcSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported), nameof(PlatformDetection.IsPreciseGcSupported))] public async Task Factory_CleanupCycle_DisposesEligibleHandler() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/ConfigureHttpClientDefaultsTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/ConfigureHttpClientDefaultsTest.cs index ce3c8929d3a870..132f50c12fe274 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/ConfigureHttpClientDefaultsTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/ConfigureHttpClientDefaultsTest.cs @@ -11,7 +11,7 @@ namespace Microsoft.Extensions.DependencyInjection // These are mostly integration tests that verify the configuration experience. public class ConfigureHttpClientDefaultsTest { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConfigureHttpClientDefaults_WithNameConfig_NameConfigUsed() { // Arrange @@ -35,7 +35,7 @@ public void ConfigureHttpClientDefaults_WithNameConfig_NameConfigUsed() Assert.Equal("http://example.com/", client.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConfigureHttpClientDefaults_MultipleConfig_LastWins() { // Arrange @@ -62,7 +62,7 @@ public void ConfigureHttpClientDefaults_MultipleConfig_LastWins() Assert.Equal("http://default2.com/", client.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConfigureHttpClientDefaults_MultipleConfigInOneDefault_LastWins() { // Arrange @@ -86,7 +86,7 @@ public void ConfigureHttpClientDefaults_MultipleConfigInOneDefault_LastWins() Assert.Equal("http://default2.com/", client.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddTypedClient_Error() { // Arrange 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 4a7c0c07492c0f..17f5d503c65f2b 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 @@ -22,7 +22,7 @@ namespace Microsoft.Extensions.DependencyInjection // These are mostly integration tests that verify the configuration experience. public class HttpClientFactoryServiceCollectionExtensionsTest { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // Verifies that AddHttpClient is enough to get the factory and make clients. + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // Verifies that AddHttpClient is enough to get the factory and make clients. public void AddHttpClient_IsSelfContained_CanCreateClient() { // Arrange @@ -43,7 +43,7 @@ public void AddHttpClient_IsSelfContained_CanCreateClient() Assert.NotNull(client); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // Verifies that AddHttpClient is enough to get the factory and make handlers. + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // Verifies that AddHttpClient is enough to get the factory and make handlers. public void AddHttpClient_IsSelfContained_CanCreateHandler() { // Arrange @@ -63,7 +63,7 @@ public void AddHttpClient_IsSelfContained_CanCreateHandler() Assert.NotNull(handler); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // Verifies that AddHttpClient registers a default client + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // Verifies that AddHttpClient registers a default client public void AddHttpClient_RegistersDefaultClientAsHttpClient() { // Arrange @@ -102,7 +102,7 @@ public void AddHttpClient_DoesNotRegisterDefaultClientIfAlreadyRegistered() Assert.Equal(TimeSpan.FromSeconds(42), client.Timeout); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithDefaultName_ConfiguresDefaultClient() { // Arrange @@ -123,7 +123,7 @@ public void AddHttpClient_WithDefaultName_ConfiguresDefaultClient() Assert.Equal("http://example.com/", client.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithName_ConfiguresNamedClient() { // Arrange @@ -143,7 +143,7 @@ public void AddHttpClient_WithName_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithDefaults_ConfiguresClient() { // Arrange @@ -167,7 +167,7 @@ public void AddHttpClient_WithDefaults_ConfiguresClient() Assert.Equal("http://example.com/", client.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClient_ConfiguresNamedClient() { // Arrange @@ -190,7 +190,7 @@ public void AddHttpClient_WithTypedClient_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithGenericTypedClient_ConfiguresNamedClient() { // Arrange @@ -213,7 +213,7 @@ public void AddHttpClient_WithGenericTypedClient_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClientAndImplementation_ConfiguresNamedClient() { // Arrange @@ -236,7 +236,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_ConfiguresNamedClient Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClient_AndName_ConfiguresNamedClient() { // Arrange @@ -259,7 +259,7 @@ public void AddHttpClient_WithTypedClient_AndName_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClientAndImplementation_AndName_ConfiguresNamedClient() { // Arrange @@ -282,7 +282,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndName_ConfiguresNam Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClient_AndDelegate_ConfiguresNamedClient() { // Arrange @@ -309,7 +309,7 @@ public void AddHttpClient_WithTypedClient_AndDelegate_ConfiguresNamedClient() Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClientAndImplementation_AndDelegate_ConfiguresNamedClient() { // Arrange @@ -336,7 +336,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndDelegate_Configure Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_AddTypedClient_ConfiguresNamedClient() { // Arrange @@ -359,7 +359,7 @@ public void AddHttpClient_AddTypedClient_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_AddTypedClientAndImplementation_ConfiguresNamedClient() { // Arrange @@ -382,7 +382,7 @@ public void AddHttpClient_AddTypedClientAndImplementation_ConfiguresNamedClient( Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_AddTypedClient_WithDelegate_ConfiguresNamedClient() { // Arrange @@ -411,7 +411,7 @@ public void AddHttpClient_AddTypedClient_WithDelegate_ConfiguresNamedClient() } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClient_WithFactory_ConfiguresNamedClient() { // Arrange @@ -439,7 +439,7 @@ public void AddHttpClient_WithTypedClient_WithFactory_ConfiguresNamedClient() Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClient_WithFactoryAndName_ConfiguresNamedClient() { // Arrange @@ -467,7 +467,7 @@ public void AddHttpClient_WithTypedClient_WithFactoryAndName_ConfiguresNamedClie Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClient_WithFactoryServices_ConfiguresNamedClient() { // Arrange @@ -495,7 +495,7 @@ public void AddHttpClient_WithTypedClient_WithFactoryServices_ConfiguresNamedCli Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClient_WithFactoryServicesAndName_ConfiguresNamedClient() { // Arrange @@ -523,7 +523,7 @@ public void AddHttpClient_WithTypedClient_WithFactoryServicesAndName_ConfiguresN Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_AddSameTypedClientTwice_WithSameName_Works() { // Arrange @@ -545,7 +545,7 @@ public void AddHttpClient_AddSameTypedClientTwice_WithSameName_Works() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_AddSameTypedClientTwice_WithSameName_WithAddTypedClient_Works() { // Arrange @@ -568,7 +568,7 @@ public void AddHttpClient_AddSameTypedClientTwice_WithSameName_WithAddTypedClien Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_AddSameTypedClientTwice_WithDifferentNames_IsAllowed() { // Arrange @@ -585,7 +585,7 @@ public void AddHttpClient_AddSameTypedClientTwice_WithDifferentNames_IsAllowed() Assert.Equal(2, clients.Count()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_AddSameTypedClientTwice_WithDifferentNames_WithAddTypedClient_IsAllowed() { // Arrange @@ -602,7 +602,7 @@ public void AddHttpClient_AddSameTypedClientTwice_WithDifferentNames_WithAddType Assert.Equal(2, clients.Count()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_TypedClient_NoHttpClientCtor_ThrowsSpecificException() { // Arrange @@ -636,7 +636,7 @@ public void AddHttpClient_AddSameNameWithTypedClientTwice_ThrowsError() ex.Message); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_AddSameNameWithTypedClientTwice_WithAddTypedClient_IsAllowed() { // Arrange @@ -664,7 +664,7 @@ public void AddHttpClient_AddSameNameWithTypedClientTwice_WithAddTypedClient_IsA Assert.Equal("http://example.com/", client2.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_AddSameNameWithTypedClientTwice_WithExplicitName_IsAllowed() { // Arrange @@ -692,7 +692,7 @@ public void AddHttpClient_AddSameNameWithTypedClientTwice_WithExplicitName_IsAll Assert.Equal("http://example.com/", client2.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_RegisteringMultipleTypes_WithAddTypedClient_IsAllowed() { // Arrange @@ -721,7 +721,7 @@ public void AddHttpClient_RegisteringMultipleTypes_WithAddTypedClient_IsAllowed( Assert.Equal("http://example.com/", client2.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_AddTypedClient_WithServiceDelegate_ConfiguresNamedClient() { // Arrange @@ -749,7 +749,7 @@ public void AddHttpClient_AddTypedClient_WithServiceDelegate_ConfiguresNamedClie Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClient_AndName_AndDelegate_ConfiguresNamedClient() { // Arrange @@ -776,7 +776,7 @@ public void AddHttpClient_WithTypedClient_AndName_AndDelegate_ConfiguresNamedCli Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void AddHttpMessageHandler_WithName_NewHandlerIsSurroundedByLogging_ForHttpClient() { // Arrange @@ -810,7 +810,7 @@ public void AddHttpMessageHandler_WithName_NewHandlerIsSurroundedByLogging_ForHt h => Assert.IsType(h)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClient_AndServiceDelegate_ConfiguresClient() { // Arrange @@ -837,7 +837,7 @@ public void AddHttpClient_WithTypedClient_AndServiceDelegate_ConfiguresClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_ConfiguresClient() { // Arrange @@ -864,7 +864,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_Co Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClient_AndServiceDelegate_ConfiguresNamedClient() { // Arrange @@ -891,7 +891,7 @@ public void AddHttpClient_WithTypedClient_AndServiceDelegate_ConfiguresNamedClie Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_ConfiguresNamedClient() { // Arrange @@ -918,7 +918,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_Co Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void AddHttpMessageHandler_WithName_NewHandlerIsSurroundedByLogging_ForHttpMessageHandler() { var serviceCollection = new ServiceCollection(); @@ -969,7 +969,7 @@ public void AddHttpClient_ProvidesSameImplementationForClientsAndHandlers() Assert.Same(clientFactory, handlerFactory); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task AddHttpClient_MessageHandler_SingletonDependency() { // Arrange @@ -1010,7 +1010,7 @@ public async Task AddHttpClient_MessageHandler_SingletonDependency() #endif } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task AddHttpClient_MessageHandler_Scope_SingletonDependency() { // Arrange @@ -1062,7 +1062,7 @@ public async Task AddHttpClient_MessageHandler_Scope_SingletonDependency() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClient_MessageHandler_ScopedDependency() { // Arrange @@ -1082,7 +1082,7 @@ public void AddHttpClient_MessageHandler_ScopedDependency() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task AddHttpClient_MessageHandler_Scope_ScopedDependency() { // Arrange @@ -1134,7 +1134,7 @@ public async Task AddHttpClient_MessageHandler_Scope_ScopedDependency() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task AddHttpClient_MessageHandler_TransientDependency() { // Arrange @@ -1175,7 +1175,7 @@ public async Task AddHttpClient_MessageHandler_TransientDependency() #endif } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task AddHttpClient_MessageHandler_Scope_TransientDependency() { // Arrange @@ -1219,7 +1219,7 @@ public async Task AddHttpClient_MessageHandler_Scope_TransientDependency() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void AddHttpClient_GetAwaiterAndResult_InSingleThreadedSynchronizationContext_ShouldNotHangs() { // Arrange @@ -1263,7 +1263,7 @@ public void AddHttpClient_GetAwaiterAndResult_InSingleThreadedSynchronizationCon } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void SuppressScope_False_CreatesNewScope() { // Arrange @@ -1291,7 +1291,7 @@ public void SuppressScope_False_CreatesNewScope() Assert.NotSame(services, capturedServices); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void SuppressScope_False_InScope_CreatesNewScope() { // Arrange @@ -1323,7 +1323,7 @@ public void SuppressScope_False_InScope_CreatesNewScope() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void SuppressScope_True_DoesNotCreateScope() { // Arrange @@ -1351,7 +1351,7 @@ public void SuppressScope_True_DoesNotCreateScope() Assert.NotSame(services, capturedServices); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void SuppressScope_True_InScope_DoesNotCreateScope() { // Arrange @@ -1382,7 +1382,7 @@ public void SuppressScope_True_InScope_DoesNotCreateScope() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [SkipOnPlatform(TestPlatforms.Browser, "Credentials is not supported on Browser")] public void AddHttpClient_ConfigurePrimaryHttpMessageHandler_ApplyChangesPrimaryHandler() { @@ -1407,7 +1407,7 @@ public void AddHttpClient_ConfigurePrimaryHttpMessageHandler_ApplyChangesPrimary Assert.Same(testCredentials, ((HttpClientHandler)testBuilder.PrimaryHandler).Credentials); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] public void AddHttpClient_ConfigureAdditionalHttpMessageHandlers_ModifyAdditionalHandlers() { // Arrange @@ -1447,7 +1447,7 @@ private sealed class TestCredentials : ICredentials public NetworkCredential GetCredential(Uri uri, string authType) => throw new NotImplementedException(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddHttpClientDefaults_MultipleConfigInOneDefault_LastWins() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/Logging/HttpClientLoggerTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/Logging/HttpClientLoggerTest.cs index 039ba46b186251..1dabceba194e26 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/Logging/HttpClientLoggerTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/Logging/HttpClientLoggerTest.cs @@ -402,7 +402,7 @@ public async Task LoggerFactoryWithHttpClientFactory_NoCircularDependency_Public Assert.Equal(0, sink.Writes.Count(w => w.LoggerName.StartsWith("System.Net.Http.HttpClient.TestLoggerProvider"))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsPreciseGcSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported), nameof(PlatformDetection.IsPreciseGcSupported))] public async Task LoggerFactoryWithHttpClientFactory_NoCircularDependency_DebugLogging() { var sink = new TestSink(); diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleFormatterTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleFormatterTests.cs index 57255617241626..40b645b43f0f44 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleFormatterTests.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleFormatterTests.cs @@ -73,7 +73,7 @@ internal static SetupDisposeHelper SetUp( return new SetupDisposeHelper(logger, sink, errorSink, levelAsString, writesPerMsg, consoleLoggerProcessor); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded() { // Arrange @@ -86,7 +86,7 @@ public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded() Assert.Equal(ConsoleFormatterNames.Simple, logger.Formatter.Name); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(FormatterNames))] public void InvalidLogLevel_Throws(string formatterName) { @@ -100,7 +100,7 @@ public void InvalidLogLevel_Throws(string formatterName) Assert.Throws(() => logger.Log((LogLevel)8, 0, _state, null, _defaultFormatter)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(FormatterNamesAndLevels))] public void NoMessageOrException_Noop(string formatterName, LogLevel level) { @@ -119,7 +119,7 @@ public void NoMessageOrException_Noop(string formatterName, LogLevel level) Assert.Equal(0, sink.Writes.Count); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(FormatterNamesAndLevels))] public void Log_LogsCorrectTimestamp(string formatterName, LogLevel level) { @@ -182,7 +182,7 @@ public void Log_LogsCorrectTimestamp(string formatterName, LogLevel level) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void NullFormatterName_Throws() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerExtensionsTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerExtensionsTests.cs index 60188dc2ce4f02..31d0df94f13f5d 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerExtensionsTests.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerExtensionsTests.cs @@ -20,7 +20,7 @@ namespace Microsoft.Extensions.Logging.Console.Test { public class ConsoleLoggerExtensionsTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddConsole_NullConfigure_Throws() { Assert.Throws(() => @@ -31,7 +31,7 @@ public void AddConsole_NullConfigure_Throws() })); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddSimpleConsole_NullConfigure_Throws() { Assert.Throws(() => @@ -42,7 +42,7 @@ public void AddSimpleConsole_NullConfigure_Throws() })); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddSystemdConsole_NullConfigure_Throws() { Assert.Throws(() => @@ -53,7 +53,7 @@ public void AddSystemdConsole_NullConfigure_Throws() })); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddJsonConsole_NullConfigure_Throws() { Assert.Throws(() => @@ -64,7 +64,7 @@ public void AddJsonConsole_NullConfigure_Throws() })); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddConsoleFormatter_NullConfigure_Throws() { Assert.Throws(() => @@ -75,7 +75,7 @@ public void AddConsoleFormatter_NullConfigure_Throws() })); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(FormatterNames))] public void AddConsole_ConsoleLoggerOptionsFromConfigFile_IsReadFromLoggingConfiguration(string formatterName) { @@ -95,7 +95,7 @@ public void AddConsole_ConsoleLoggerOptionsFromConfigFile_IsReadFromLoggingConfi Assert.Equal(formatterName, logger.Options.FormatterName); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddConsoleFormatter_CustomFormatter_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -154,7 +154,7 @@ private class CustomOptions : ConsoleFormatterOptions public string CustomLabel { get; set; } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddSimpleConsole_ChangeProperties_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -184,7 +184,7 @@ public void AddSimpleConsole_ChangeProperties_IsReadFromLoggingConfiguration() Assert.True(formatter.FormatterOptions.IncludeScopes); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddSimpleConsole_OutsideConfig_TakesProperty() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -214,7 +214,7 @@ public void AddSimpleConsole_OutsideConfig_TakesProperty() Assert.True(formatter.FormatterOptions.UseUtcTimestamp); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddSystemdConsole_ChangeProperties_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -240,7 +240,7 @@ public void AddSystemdConsole_ChangeProperties_IsReadFromLoggingConfiguration() Assert.True(formatter.FormatterOptions.IncludeScopes); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddSystemdConsole_OutsideConfig_TakesProperty() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -270,7 +270,7 @@ public void AddSystemdConsole_OutsideConfig_TakesProperty() Assert.False(formatter.FormatterOptions.IncludeScopes); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddJsonConsole_ChangeProperties_IsReadFromLoggingConfiguration() { var newLine = Environment.NewLine.Length is 2 ? "\n" : "\r\n"; @@ -301,7 +301,7 @@ public void AddJsonConsole_ChangeProperties_IsReadFromLoggingConfiguration() Assert.Equal(newLine, formatter.FormatterOptions.JsonWriterOptions.NewLine); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddJsonConsole_OutsideConfig_TakesProperty() { var newLine = Environment.NewLine.Length is 2 ? "\n" : "\r\n"; @@ -338,7 +338,7 @@ public void AddJsonConsole_OutsideConfig_TakesProperty() Assert.Equal(JavaScriptEncoder.UnsafeRelaxedJsonEscaping, formatter.FormatterOptions.JsonWriterOptions.Encoder); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddConsole_NullFormatterNameUsingSystemdFormat_AnyDeprecatedPropertiesOverwriteFormatterOptions() { var configs = new[] { @@ -363,7 +363,7 @@ public void AddConsole_NullFormatterNameUsingSystemdFormat_AnyDeprecatedProperti Assert.Equal("HH:mm:ss ", formatter.FormatterOptions.TimestampFormat); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(-1)] [InlineData(0)] public void AddConsole_MaxQueueLengthSetToNegativeOrZero_Throws(int invalidMaxQueueLength) @@ -383,7 +383,7 @@ public void AddConsole_MaxQueueLengthSetToNegativeOrZero_Throws(int invalidMaxQu Assert.Throws(() => serviceProvider.GetRequiredService()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddConsole_MaxQueueLengthLargerThanZero_ConfiguredProperly() { var configs = new[] { @@ -404,7 +404,7 @@ public void AddConsole_MaxQueueLengthLargerThanZero_ConfiguredProperly() Assert.Equal(12345, logger.Options.MaxQueueLength); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddConsole_NullFormatterName_UsingSystemdFormat_IgnoreFormatterOptionsAndUseDeprecatedInstead() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -436,7 +436,7 @@ public void AddConsole_NullFormatterName_UsingSystemdFormat_IgnoreFormatterOptio Assert.False(formatter.FormatterOptions.IncludeScopes); // setup using lambda wins over config } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AddConsole_NullFormatterName_UsingDefaultFormat_IgnoreFormatterOptionsAndUseDeprecatedInstead() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -475,7 +475,7 @@ public void AddConsole_NullFormatterName_UsingDefaultFormat_IgnoreFormatterOptio Assert.Equal(LoggerColorBehavior.Disabled, formatter.FormatterOptions.ColorBehavior); // setup using lambda } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData("missingFormatter")] [InlineData("simple")] [InlineData("Simple")] @@ -518,7 +518,7 @@ public void AddConsole_FormatterNameIsSet_UsingDefaultFormat_IgnoreDeprecatedAnd Assert.Equal(LoggerColorBehavior.Default, formatter.FormatterOptions.ColorBehavior); // ignore deprecated set in lambda, defaulted to false } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData("missingFormatter")] [InlineData("systemd")] [InlineData("Systemd")] diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerProcessorTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerProcessorTests.cs index 1ded891d402c04..e4d4b99b64ef1e 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerProcessorTests.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerProcessorTests.cs @@ -14,7 +14,7 @@ public class ConsoleLoggerProcessorTests { private const string _loggerName = "test"; - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void LogAfterDisposeWritesLog() { // Arrange @@ -36,7 +36,7 @@ public void LogAfterDisposeWritesLog() Assert.Equal(2, sink.Writes.Count); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void LogsFlushedAfterDispose() { // Arrange @@ -62,7 +62,7 @@ public void LogsFlushedAfterDispose() Assert.Equal(2*repetitions, sink.Writes.Count); // 2 writes per message (category and msg) } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(-1)] [InlineData(0)] public static void MaxQueueLength_SetInvalid_Throws(int invalidMaxQueueLength) @@ -76,7 +76,7 @@ public static void MaxQueueLength_SetInvalid_Throws(int invalidMaxQueueLength) Assert.Throws(() => processor.MaxQueueLength = invalidMaxQueueLength); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void FullMode_SetInvalid_Throws() { // Arrange @@ -89,7 +89,7 @@ public static void FullMode_SetInvalid_Throws() } [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(true)] [InlineData(false)] public void CheckForNotificationWhenQueueIsFull(bool okToDrop) @@ -145,7 +145,7 @@ public void Write(string message) } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ThrowDuringProcessLog_ShutsDownGracefully() { var console = new TimesWriteCalledConsole(); diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerTest.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerTest.cs index f48a4a0e1176ab..42ec3e9ec21fc2 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerTest.cs @@ -174,7 +174,7 @@ internal static string GetJsonLogLevelString(LogLevel logLevel) }; } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void LogsWhenMessageIsNotProvided() { // Arrange @@ -206,7 +206,7 @@ public void LogsWhenMessageIsNotProvided() GetMessage(sink.Writes.GetRange(2 * t.WritesPerMsg, t.WritesPerMsg))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void DoesNotLog_NewLine_WhenNoExceptionIsProvided() { // Arrange @@ -234,7 +234,7 @@ public void DoesNotLog_NewLine_WhenNoExceptionIsProvided() Assert.Equal(expected2, GetMessage(sink.Writes.GetRange(3 * t.WritesPerMsg, t.WritesPerMsg))); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(null, 0)] [InlineData(null, 1)] [InlineData("missingFormatter", 0)] @@ -275,7 +275,7 @@ public void Options_FormatterNameNull_UsesDeprecatedProperties(string? formatter } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData("Route with name 'Simple' was not found.")] public void Writes_NewLine_WhenExceptionIsProvided(string message) { @@ -299,7 +299,7 @@ public void Writes_NewLine_WhenExceptionIsProvided(string message) Assert.Equal(expectedHeader + expectedMessage + expectedExceptionMessage, sink.Writes[1].Message); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ThrowsException_WhenNoFormatterIsProvided() { // Arrange @@ -310,7 +310,7 @@ public void ThrowsException_WhenNoFormatterIsProvided() Assert.Throws(() => logger.Log(LogLevel.Trace, 1, "empty", new Exception(), null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void LogsWhenNullFilterGiven() { // Arrange @@ -331,7 +331,7 @@ public void LogsWhenNullFilterGiven() Assert.Equal(expectedHeader + expectedMessage, sink.Writes[1].Message); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void WriteCritical_LogsCorrectColors() { // Arrange @@ -352,7 +352,7 @@ public void WriteCritical_LogsCorrectColors() Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void WriteError_LogsCorrectColors() { // Arrange @@ -373,7 +373,7 @@ public void WriteError_LogsCorrectColors() Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void WriteWarning_LogsCorrectColors() { // Arrange @@ -394,7 +394,7 @@ public void WriteWarning_LogsCorrectColors() Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void WriteInformation_LogsCorrectColors() { // Arrange @@ -445,7 +445,7 @@ public void AddConsole_IsOutputRedirected_ColorDisabled() }, new RemoteInvokeOptions { StartInfo = new ProcessStartInfo() { RedirectStandardOutput = true } }).Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void WriteDebug_LogsCorrectColors() { // Arrange @@ -466,7 +466,7 @@ public void WriteDebug_LogsCorrectColors() Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void WriteTrace_LogsCorrectColors() { // Arrange @@ -487,7 +487,7 @@ public void WriteTrace_LogsCorrectColors() Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void WriteAllLevelsDisabledColors_LogsNoColors() { // Arrange @@ -511,7 +511,7 @@ public void WriteAllLevelsDisabledColors_LogsNoColors() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void Log_LogsCorrectTimestamp(ConsoleLoggerFormat format, LogLevel level) { @@ -571,7 +571,7 @@ public BufferedLogRecordImpl(DateTimeOffset timestamp, LogLevel level, string ex public override string? Exception => _exception; } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void Log_LogsCorrectOverrideTimestamp(ConsoleLoggerFormat format, LogLevel level) { @@ -615,7 +615,7 @@ public void Log_LogsCorrectOverrideTimestamp(ConsoleLoggerFormat format, LogLeve } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void WriteCore_LogsCorrectTimestampInUtc(ConsoleLoggerFormat format, LogLevel level) { @@ -656,7 +656,7 @@ public void WriteCore_LogsCorrectTimestampInUtc(ConsoleLoggerFormat format, LogL } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void WriteCore_LogsCorrectMessages(ConsoleLoggerFormat format, LogLevel level) { @@ -700,7 +700,7 @@ public void WriteCore_LogsCorrectMessages(ConsoleLoggerFormat format, LogLevel l } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void NoLogScope_DoesNotWriteAnyScopeContentToOutput() { // Arrange @@ -721,7 +721,7 @@ public void NoLogScope_DoesNotWriteAnyScopeContentToOutput() Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void WritingScopes_LogsWithCorrectColors() { // Arrange @@ -747,7 +747,7 @@ public void WritingScopes_LogsWithCorrectColors() Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(Formats))] public void WritingScopes_LogsExpectedMessage(ConsoleLoggerFormat format) { @@ -798,7 +798,7 @@ public void WritingScopes_LogsExpectedMessage(ConsoleLoggerFormat format) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(Formats))] public void WritingNestedScope_LogsNullScopeName(ConsoleLoggerFormat format) { @@ -847,7 +847,7 @@ public void WritingNestedScope_LogsNullScopeName(ConsoleLoggerFormat format) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(Formats))] public void WritingNestedScopes_LogsExpectedMessage(ConsoleLoggerFormat format) { @@ -905,7 +905,7 @@ public void WritingNestedScopes_LogsExpectedMessage(ConsoleLoggerFormat format) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(Formats))] public void WritingMultipleScopes_LogsExpectedMessage(ConsoleLoggerFormat format) { @@ -974,7 +974,7 @@ public void WritingMultipleScopes_LogsExpectedMessage(ConsoleLoggerFormat format } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void CallingBeginScopeOnLogger_AlwaysReturnsNewDisposableInstance() { // Arrange @@ -992,7 +992,7 @@ public void CallingBeginScopeOnLogger_AlwaysReturnsNewDisposableInstance() Assert.NotSame(disposable1, disposable2); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void CallingBeginScopeOnLogger_ReturnsNonNullableInstance() { // Arrange @@ -1007,7 +1007,7 @@ public void CallingBeginScopeOnLogger_ReturnsNonNullableInstance() Assert.NotNull(disposable); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(Formats))] public void ConsoleLoggerLogsToError_WhenOverErrorLevel(ConsoleLoggerFormat format) { @@ -1057,7 +1057,7 @@ public void ConsoleLoggerLogsToError_WhenOverErrorLevel(ConsoleLoggerFormat form } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void WriteCore_NullMessageWithException(ConsoleLoggerFormat format, LogLevel level) { @@ -1101,7 +1101,7 @@ public void WriteCore_NullMessageWithException(ConsoleLoggerFormat format, LogLe } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void WriteCore_EmptyMessageWithException(ConsoleLoggerFormat format, LogLevel level) { @@ -1144,7 +1144,7 @@ public void WriteCore_EmptyMessageWithException(ConsoleLoggerFormat format, LogL } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void WriteCore_MessageWithNullException(ConsoleLoggerFormat format, LogLevel level) { @@ -1184,7 +1184,7 @@ public void WriteCore_MessageWithNullException(ConsoleLoggerFormat format, LogLe } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(Levels))] public void WriteCore_NullMessageWithNullException(LogLevel level) { @@ -1202,7 +1202,7 @@ public void WriteCore_NullMessageWithNullException(LogLevel level) Assert.Empty(sink.Writes); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void IsEnabledReturnsCorrectValue() { var logger = SetUp().Logger; @@ -1216,7 +1216,7 @@ public static void IsEnabledReturnsCorrectValue() Assert.True(logger.IsEnabled(LogLevel.Trace)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_DisableColors_IsAppliedToLoggers() { // Arrange @@ -1230,13 +1230,13 @@ public void ConsoleLoggerOptions_DisableColors_IsAppliedToLoggers() Assert.False(logger.Options.DisableColors); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_InvalidFormat_Throws() { Assert.Throws(() => new ConsoleLoggerOptions() { Format = (ConsoleLoggerFormat)10 }); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(-1)] [InlineData(0)] public void ConsoleLoggerOptions_SetInvalidMaxQueueLength_Throws(int invalidMaxQueueLength) @@ -1244,13 +1244,13 @@ public void ConsoleLoggerOptions_SetInvalidMaxQueueLength_Throws(int invalidMaxQ Assert.Throws(() => new ConsoleLoggerOptions() { MaxQueueLength = invalidMaxQueueLength }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_SetInvalidBufferMode_Throws() { Assert.Throws(() => new ConsoleLoggerOptions() { QueueFullMode = (ConsoleLoggerQueueFullMode)10 }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_DisableColors_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:DisableColors", "true") }).Build(); @@ -1267,7 +1267,7 @@ public void ConsoleLoggerOptions_DisableColors_IsReadFromLoggingConfiguration() Assert.True(logger.Options.DisableColors); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded() { // Arrange @@ -1281,7 +1281,7 @@ public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded() Assert.Equal("yyyyMMddHHmmss", logger.Options.TimestampFormat); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_TimeStampFormat_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:TimeStampFormat", "yyyyMMddHHmmss") }).Build(); @@ -1298,7 +1298,7 @@ public void ConsoleLoggerOptions_TimeStampFormat_IsReadFromLoggingConfiguration( Assert.Equal("yyyyMMddHHmmss", logger.Options.TimestampFormat); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_TimeStampFormat_MultipleReloads() { var monitor = new TestOptionsMonitor(new ConsoleLoggerOptions()); @@ -1312,7 +1312,7 @@ public void ConsoleLoggerOptions_TimeStampFormat_MultipleReloads() Assert.Equal("yyyyMMddHHmmss", logger.Options.TimestampFormat); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_IncludeScopes_IsAppliedToLoggers() { // Arrange @@ -1326,7 +1326,7 @@ public void ConsoleLoggerOptions_IncludeScopes_IsAppliedToLoggers() Assert.False(logger.Options.IncludeScopes); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_LogAsErrorLevel_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:LogToStandardErrorThreshold", "Warning") }).Build(); @@ -1343,7 +1343,7 @@ public void ConsoleLoggerOptions_LogAsErrorLevel_IsReadFromLoggingConfiguration( Assert.Equal(LogLevel.Warning, logger.Options.LogToStandardErrorThreshold); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_LogAsErrorLevel_IsAppliedToLoggers() { // Arrange @@ -1357,7 +1357,7 @@ public void ConsoleLoggerOptions_LogAsErrorLevel_IsAppliedToLoggers() Assert.Equal(LogLevel.Error, logger.Options.LogToStandardErrorThreshold); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_UpdateQueueOptions_UpdatesConsoleLoggerProcessorProperties() { // Arrange @@ -1376,7 +1376,7 @@ public void ConsoleLoggerOptions_UpdateQueueOptions_UpdatesConsoleLoggerProcesso Assert.Equal(10, logger.Options.MaxQueueLength); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_UseUtcTimestamp_IsAppliedToLoggers() { // Arrange @@ -1390,7 +1390,7 @@ public void ConsoleLoggerOptions_UseUtcTimestamp_IsAppliedToLoggers() Assert.True(logger.Options.UseUtcTimestamp); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConsoleLoggerOptions_IncludeScopes_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:IncludeScopes", "true") }).Build(); @@ -1409,7 +1409,7 @@ public void ConsoleLoggerOptions_IncludeScopes_IsReadFromLoggingConfiguration() Assert.True(formatter.FormatterOptions.IncludeScopes); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void LogMultipleArrays() { // Arrange @@ -1500,7 +1500,7 @@ private string CreateHeader(ConsoleLoggerFormat format, int eventId = 0) } public static bool IsThreadingAndRemoteExecutorSupported => - PlatformDetection.IsThreadingSupported && RemoteExecutor.IsSupported; + PlatformDetection.IsMultithreadingSupported && RemoteExecutor.IsSupported; } internal class TestLoggerProcessor : ConsoleLoggerProcessor diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/JsonConsoleFormatterTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/JsonConsoleFormatterTests.cs index e70b31fa5bd144..7f96c5d6d31d03 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/JsonConsoleFormatterTests.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/JsonConsoleFormatterTests.cs @@ -17,7 +17,7 @@ namespace Microsoft.Extensions.Logging.Console.Test { public class JsonConsoleFormatterTests : ConsoleFormatterTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void NoLogScope_DoesNotWriteAnyScopeContentToOutput_Json() { // Arrange @@ -51,7 +51,7 @@ public void NoLogScope_DoesNotWriteAnyScopeContentToOutput_Json() Assert.Contains("SimpleScope", write.Message); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Log_TimestampFormatSet_ContainsTimestamp() { // Arrange @@ -78,7 +78,7 @@ public void Log_TimestampFormatSet_ContainsTimestamp() GetMessage(sink.Writes.GetRange(0 * t.WritesPerMsg, t.WritesPerMsg))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Log_NullMessage_LogsWhenMessageIsNotProvided() { // Arrange @@ -122,7 +122,7 @@ public void Log_NullMessage_LogsWhenMessageIsNotProvided() GetMessage(sink.Writes.GetRange(2 * t.WritesPerMsg, t.WritesPerMsg))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Log_ExceptionWithMessage_ExtractsInfo() { // Arrange @@ -176,7 +176,7 @@ public void Log_ExceptionWithMessage_ExtractsInfo() GetMessage(sink.Writes.GetRange(2 * t.WritesPerMsg, t.WritesPerMsg))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Log_IncludeScopes_ContainsDuplicateNamedPropertiesInScope_AcceptableJson() { // Arrange @@ -209,7 +209,7 @@ public void Log_IncludeScopes_ContainsDuplicateNamedPropertiesInScope_Acceptable GetMessage(sink.Writes.GetRange(0 * t.WritesPerMsg, t.WritesPerMsg))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Log_StateAndScopeAreCollections_IncludesMessageAndCollectionValues() { // Arrange @@ -244,7 +244,7 @@ public void Log_StateAndScopeAreCollections_IncludesMessageAndCollectionValues() GetMessage(sink.Writes.GetRange(0 * t.WritesPerMsg, t.WritesPerMsg))); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(SpecialCaseValues))] public void Log_StateAndScopeContainsSpecialCaseValue_SerializesValueAsExpected(object value, string expectedJsonValue) { @@ -274,7 +274,7 @@ public void Log_StateAndScopeContainsSpecialCaseValue_SerializesValueAsExpected( Assert.Contains("\"LogEntryValue\":" + expectedJsonValue + ",", message); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(FloatingPointValues))] public void Log_StateAndScopeContainsFloatingPointType_SerializesValue(object value) { @@ -313,7 +313,7 @@ static void AssertMessageValue(string message, string propertyName) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Log_StateAndScopeContainsNullValue_SerializesNull() { // Arrange @@ -342,7 +342,7 @@ public void Log_StateAndScopeContainsNullValue_SerializesNull() Assert.Contains("\"LogKey\":null", message); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Log_ScopeIsIEnumerable_SerializesKeyValuePair() { // Arrange @@ -508,7 +508,7 @@ private string GetJson(Exception exception, bool indented) } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void ShouldContainInnerException(bool indented) @@ -534,7 +534,7 @@ static string GetContent(Exception exception) .Replace(Environment.NewLine, newLineReplacement); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void ShouldContainAggregateExceptions(bool indented) diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/SimpleConsoleFormatterTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/SimpleConsoleFormatterTests.cs index 5e5c03839f0bc6..e361cf1bbf9436 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/SimpleConsoleFormatterTests.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/SimpleConsoleFormatterTests.cs @@ -9,11 +9,11 @@ namespace Microsoft.Extensions.Logging.Console.Test { public class SimpleConsoleFormatterTests : ConsoleFormatterTests { - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(LoggerColorBehavior.Default)] [InlineData(LoggerColorBehavior.Enabled)] [InlineData(LoggerColorBehavior.Disabled)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/97382", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/97382", typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Log_WritingScopes_LogsWithCorrectColorsWhenColorEnabled(LoggerColorBehavior colorBehavior) { // Arrange @@ -54,7 +54,7 @@ public void Log_WritingScopes_LogsWithCorrectColorsWhenColorEnabled(LoggerColorB } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Log_NoLogScope_DoesNotWriteAnyScopeContentToOutput() { // Arrange @@ -78,7 +78,7 @@ public void Log_NoLogScope_DoesNotWriteAnyScopeContentToOutput() Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Log_SingleLine_LogsWhenMessageIsNotProvided() { // Arrange @@ -109,7 +109,7 @@ public void Log_SingleLine_LogsWhenMessageIsNotProvided() GetMessage(sink.Writes.GetRange(2 * t.WritesPerMsg, t.WritesPerMsg))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Log_SingleLine_LogsWhenBothMessageAndExceptionProvided() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs b/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs index b3718cf84b736e..14111e591898b3 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs +++ b/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs @@ -106,7 +106,7 @@ public void ActiveChangeCallbacks_IsFalse_IfNoTokenHasActiveChangeCallbacks() Assert.False(compositeChangeToken.ActiveChangeCallbacks); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task RegisteredCallbackGetsInvokedExactlyOnce_WhenMultipleConcurrentChangeEventsOccur() { // Arrange @@ -171,7 +171,7 @@ public void ShouldNotCollectDisposablesIfChangedTokenEncountered() Assert.Equal(1, count); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task NoDeadlock_WhenMultipleConcurrentChangeEventsOccur() { // Arrange diff --git a/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionCancellationTests.cs b/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionCancellationTests.cs index a5c48680d803a1..fb476ee5097f59 100644 --- a/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionCancellationTests.cs +++ b/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionCancellationTests.cs @@ -8,7 +8,7 @@ namespace System.Collections.Concurrent.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public class BlockingCollectionCancellationTests { [Fact] diff --git a/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionTests.cs b/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionTests.cs index d9c202b4f9df05..9ea9f1b8f56aae 100644 --- a/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionTests.cs +++ b/src/libraries/System.Collections.Concurrent/tests/BlockingCollectionTests.cs @@ -13,7 +13,7 @@ namespace System.Collections.Concurrent.Tests { /// The class that contains the unit tests of the BlockingCollection. - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public class BlockingCollectionTests { [Fact] diff --git a/src/libraries/System.Collections.Concurrent/tests/ConcurrentBagTests.cs b/src/libraries/System.Collections.Concurrent/tests/ConcurrentBagTests.cs index 41caa3244f8124..fbdb6fbd929c3f 100644 --- a/src/libraries/System.Collections.Concurrent/tests/ConcurrentBagTests.cs +++ b/src/libraries/System.Collections.Concurrent/tests/ConcurrentBagTests.cs @@ -21,7 +21,7 @@ public class ConcurrentBagTests : ProducerConsumerCollectionTests protected override string CopyToNoLengthParamName => "index"; - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(1, 10)] [InlineData(3, 100)] [InlineData(8, 1000)] @@ -47,7 +47,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.IsMultithreadingSupported))] public static void AddOnOneThread_PeekOnAnother_EnsureWeCanTakeOnTheOriginal() { var bag = new ConcurrentBag(Enumerable.Range(1, 5)); @@ -78,7 +78,7 @@ public static void AddOnOneThread_PeekOnAnother_EnsureWeCanTakeOnTheOriginal() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void AddManyItems_ThenTakeOnDifferentThread_ItemsOutputInExpectedOrder() { var bag = new ConcurrentBag(Enumerable.Range(0, 100000)); @@ -93,7 +93,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.IsMultithreadingSupported))] public static void SingleProducerAdding_MultiConsumerTaking_SemaphoreThrottling_AllTakesSucceed() { var bag = new ConcurrentBag(); @@ -149,7 +149,7 @@ public static void SingleProducerAdding_MultiConsumerTaking_SemaphoreThrottling_ ce.Wait(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(10)] @@ -212,7 +212,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.IsMultithreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(10)] @@ -262,7 +262,7 @@ public bool TryTake(out int item) IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false, 0)] [InlineData(false, 1)] [InlineData(false, 20)] @@ -313,7 +313,7 @@ public static void Clear_DuringEnumeration_DoesntAffectEnumeration() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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 870ad572ff1711..5c4a7e8537e9e3 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.IsMultithreadingSupported))] public static void TestBasicScenarios() { ConcurrentDictionary cd = new ConcurrentDictionary(); @@ -123,7 +123,7 @@ public static void TestAddValueOfDifferentType() Assert.Throws(action); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(1, 1, 1, 10000)] [InlineData(5, 1, 1, 10000)] [InlineData(1, 1, 2, 5000)] @@ -188,7 +188,7 @@ public static void TestAdd(int cLevel, int initSize, int threads, int addsPerThr Assert.Equal(expectedCount, dictConcurrent.ToArray().Length); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(1, 1, 10000)] [InlineData(5, 1, 10000)] [InlineData(1, 2, 5000)] @@ -252,7 +252,7 @@ public static void TestUpdate(int cLevel, int threads, int updatesPerThread) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(1, 1, 10000)] [InlineData(5, 1, 10000)] [InlineData(1, 2, 5000)] @@ -296,7 +296,7 @@ public static void TestRead1(int cLevel, int threads, int readsPerThread) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(1, 1, 10000)] [InlineData(5, 1, 1000)] [InlineData(1, 5, 2001)] @@ -364,7 +364,7 @@ public static void TestRemove1(int cLevel, int threads, int removesPerThread) Assert.Equal(expectKeys.Count, dict.ToArray().Length); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(1)] [InlineData(10)] [InlineData(5000)] @@ -482,7 +482,7 @@ public static void TryRemove_KeyValuePair_MatchesKeyWithDefaultComparer() Assert.True(dict.TryRemove(KeyValuePair.Create("KEY", "value"))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TestGetOrAdd() { TestGetOrAddOrUpdate(1, 1, 1, 10000, true); @@ -495,7 +495,7 @@ public static void TestGetOrAdd() TestGetOrAddOrUpdate(5, 5, 5, 25000, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TestAddOrUpdate() { TestGetOrAddOrUpdate(1, 1, 1, 10000, false); @@ -1007,7 +1007,7 @@ public static void TestCapacity(int capacity) Assert.Equal(capacity, GetCapacity(dictionary)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TestTryUpdate() { var dictionary = new ConcurrentDictionary(); @@ -1089,7 +1089,7 @@ public static void TestTryUpdate() } [OuterLoop("Runs for several seconds")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ConcurrentWriteRead_NoTornValues() { var cd = new ConcurrentDictionary>(); diff --git a/src/libraries/System.Collections.Concurrent/tests/ConcurrentQueueTests.cs b/src/libraries/System.Collections.Concurrent/tests/ConcurrentQueueTests.cs index eb0299a260eb03..6ec3ce8b0b5be2 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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..1fe218e01aded8 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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..33fddfe816d52f 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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..1ec0ae19d9aca7 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [InlineData(100, 1, 10)] [InlineData(4, 100000, 10)] public void BlockingCollection_WrappingCollection_ExpectedElementsTransferred(int numThreadsPerConsumerProducer, int numItemsPerThread, int producerSpin) @@ -564,7 +564,7 @@ public void GetEnumerator_EnumerationsAreSnapshots() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0, true)] [InlineData(1, true)] [InlineData(1, false)] @@ -637,7 +637,7 @@ public void ICollection_IsSynchronized_SyncRoot() Assert.Throws(() => c.SyncRoot); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [InlineData(1, ConcurrencyTestSeconds / 2)] [InlineData(4, ConcurrencyTestSeconds / 2)] public void ManyConcurrentAddsTakes_EnsureTrackedCountsMatchResultingCollection(int threadsPerProc, double seconds) @@ -735,7 +735,7 @@ public void ManyConcurrentAddsTakes_EnsureTrackedCountsMatchResultingCollection( } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] public void ManyConcurrentAddsTakes_CollectionRemainsConsistent() { @@ -766,7 +766,7 @@ public void ManyConcurrentAddsTakes_CollectionRemainsConsistent() Assert.Empty(c); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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 f42957f3fac3a1..80a3ec1a37e6f0 100644 --- a/src/libraries/System.Collections.Immutable/tests/ImmutableArrayTest.cs +++ b/src/libraries/System.Collections.Immutable/tests/ImmutableArrayTest.cs @@ -2521,7 +2521,7 @@ public void OfType() Assert.Equal(new[] { "1" }, s_twoElementRefTypeWithNull.OfType()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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..202870f99c4f13 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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 e10903293d446c..cb423fe50ba19e 100644 --- a/src/libraries/System.Collections.NonGeneric/tests/ArrayListTests.cs +++ b/src/libraries/System.Collections.NonGeneric/tests/ArrayListTests.cs @@ -2714,7 +2714,7 @@ public class ArrayList_SyncRootTests private ArrayList _arrDaughter; private ArrayList _arrGrandDaughter; - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void GetSyncRoot() { const int NumberOfElements = 100; @@ -3004,7 +3004,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.IsMultithreadingSupported))] public void Synchronized_ArrayList() { // Make 40 threads which add strHeroes to an ArrayList @@ -3026,7 +3026,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.IsMultithreadingSupported))] 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..68a6af20f01437 100644 --- a/src/libraries/System.Collections.NonGeneric/tests/HashtableTests.cs +++ b/src/libraries/System.Collections.NonGeneric/tests/HashtableTests.cs @@ -998,7 +998,7 @@ public class Hashtable_ItemThreadSafetyTests private const int MAX_TEST_TIME_MS = 10000; // 10 seconds - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] public void GetItem_ThreadSafety() { @@ -1091,7 +1091,7 @@ public class Hashtable_SynchronizedTests private Hashtable _hash2; private int _iNumberOfElements = 20; - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] public void SynchronizedThreadSafety() { @@ -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.IsMultithreadingSupported))] 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..40808bc13eddca 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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..c3ccc3a3c7c43e 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.IsMultithreadingSupported))] [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..4ef4e7d47c0764 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.IsMultithreadingSupported))] public void GetSyncRootBasic() { // Testing SyncRoot is not as simple as its implementation looks like. This is the working diff --git a/src/libraries/System.Collections/tests/Generic/Dictionary/Dictionary.Generic.Tests.ConcurrentAccessDetection.cs b/src/libraries/System.Collections/tests/Generic/Dictionary/Dictionary.Generic.Tests.ConcurrentAccessDetection.cs index 6e465881483bf7..bbfc049c2f9968 100644 --- a/src/libraries/System.Collections/tests/Generic/Dictionary/Dictionary.Generic.Tests.ConcurrentAccessDetection.cs +++ b/src/libraries/System.Collections/tests/Generic/Dictionary/Dictionary.Generic.Tests.ConcurrentAccessDetection.cs @@ -37,7 +37,7 @@ private async Task DictionaryConcurrentAccessDetection(Dictionary< await task.WaitAsync(TimeSpan.FromSeconds(60)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(null)] [InlineData(typeof(CustomEqualityComparerInt32ValueType))] public async Task DictionaryConcurrentAccessDetection_ValueTypeKey(Type? comparerType) @@ -59,7 +59,7 @@ await DictionaryConcurrentAccessDetection(dic, d => d.Remove(1, out int value)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(null)] [InlineData(typeof(CustomEqualityComparerDummyRefType))] public async Task DictionaryConcurrentAccessDetection_ReferenceTypeKey(Type? comparerType) diff --git a/src/libraries/System.ComponentModel.EventBasedAsync/tests/AsyncOperationTests.cs b/src/libraries/System.ComponentModel.EventBasedAsync/tests/AsyncOperationTests.cs index 1d32eb1d059a0f..1925c806a8d1db 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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..c211e7ac3b496c 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.IsMultithreadingSupported))] public void TestBackgroundWorkerBasic() { var original = SynchronizationContext.Current; @@ -70,7 +70,7 @@ public void TestBackgroundWorkerBasic() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task RunWorkerAsync_NoOnWorkHandler_SetsResultToNull() { var tcs = new TaskCompletionSource(); @@ -91,7 +91,7 @@ public async Task RunWorkerAsync_NoOnWorkHandler_SetsResultToNull() private ManualResetEventSlim manualResetEvent3; - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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 aaf8c5540d5284..ee84679fc19858 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.IsMultithreadingSupported))] public void TestTimerStartAutoReset() { using (var timer = new TestTimer(1)) @@ -116,7 +116,7 @@ public void TestInterval(double interval) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void SettingAutoResetOrIntervalOnDisabledOneShotTimerDoesNotRestartIt() { 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..a59527d39313fc 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.IsMultithreadingSupported))] public void SharedInstancesAreNotVisibleUntilActivationCompletes() { var c = CreateContainer(typeof(PausesDuringActivation)); diff --git a/src/libraries/System.Console/tests/ReadAndWrite.cs b/src/libraries/System.Console/tests/ReadAndWrite.cs index 546ce2568695ab..686d6d5e0a8e91 100644 --- a/src/libraries/System.Console/tests/ReadAndWrite.cs +++ b/src/libraries/System.Console/tests/ReadAndWrite.cs @@ -161,7 +161,7 @@ public static async Task OutWriteAndWriteLineOverloads() TextWriter writer = Console.Out; Assert.NotNull(writer); // single-threaded WASM bypasses SyncTextWriter for faster startup - if (PlatformDetection.IsThreadingSupported) + if (PlatformDetection.IsMultithreadingSupported) Assert.NotEqual(writer, sw); // the writer we provide gets wrapped else Assert.Equal(writer, sw); // the writer we provide does not get wrapped diff --git a/src/libraries/System.Console/tests/SyncTextWriter.cs b/src/libraries/System.Console/tests/SyncTextWriter.cs index bcd0b12ddb426d..5ab8c446b23066 100644 --- a/src/libraries/System.Console/tests/SyncTextWriter.cs +++ b/src/libraries/System.Console/tests/SyncTextWriter.cs @@ -13,7 +13,7 @@ public class SyncTextWriter { // single-threaded WASM bypasses SyncTextWriter for faster startup - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void SyncTextWriterLockedOnThis() { TextWriter oldWriter = Console.Out; diff --git a/src/libraries/System.Console/tests/WindowAndCursorProps.cs b/src/libraries/System.Console/tests/WindowAndCursorProps.cs index edac5a399873e9..019fd49c934dda 100644 --- a/src/libraries/System.Console/tests/WindowAndCursorProps.cs +++ b/src/libraries/System.Console/tests/WindowAndCursorProps.cs @@ -268,7 +268,7 @@ public static void Title_SetNull_ThrowsArgumentNullException() AssertExtensions.Throws("value", () => Console.Title = null); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] // makes noise, not very inner-loop friendly public static void Beep_Invoke_Success() { diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivityTests.cs index 9984a0548dd975..af9540f0203e18 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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 7be9494d77b05e..c006114a42a26a 100644 --- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/DiagnosticSourceTests.cs +++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/DiagnosticSourceTests.cs @@ -371,7 +371,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.IsMultithreadingSupported))] public void MultiSubscriberStress() { using (DiagnosticListener listener = new DiagnosticListener("MultiSubscriberStressTest")) @@ -532,7 +532,7 @@ public void AllListenersCheckCatchupList() /// Stresses the AllListeners by having many threads be adding and removing. /// [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(100, 100)] // run multiple times to stress it further [InlineData(100, 101)] [InlineData(100, 102)] diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/TestWithConfigSwitches/ActivityTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/TestWithConfigSwitches/ActivityTests.cs index 808e1c779ef1b6..a6b7088222a240 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.IsMultithreadingSupported))] public void IdGenerationInternalParent() { var parent = new Activity("parent"); diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.cs index 31e07542aac42a..6c97c4424f6ba1 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessThreadTests.cs @@ -108,7 +108,7 @@ public void TestStartTimeProperty_OSX() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [PlatformSpecific(TestPlatforms.Linux | TestPlatforms.Windows)] // OSX and FreeBSD throw PNSE from StartTime public async Task TestStartTimeProperty() { diff --git a/src/libraries/System.Diagnostics.TraceSource/tests/System.Diagnostics.TraceSource.Tests/CorrelationManagerTests.cs b/src/libraries/System.Diagnostics.TraceSource/tests/System.Diagnostics.TraceSource.Tests/CorrelationManagerTests.cs index a6828a72f9c180..311e0ca5851a40 100644 --- a/src/libraries/System.Diagnostics.TraceSource/tests/System.Diagnostics.TraceSource.Tests/CorrelationManagerTests.cs +++ b/src/libraries/System.Diagnostics.TraceSource/tests/System.Diagnostics.TraceSource.Tests/CorrelationManagerTests.cs @@ -52,7 +52,7 @@ public void CorrelationManager_ActivityId() Assert.Equal(id, Trace.CorrelationManager.ActivityId); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CorrelationManager_MutateStackPush() { Guid id = Guid.NewGuid(); @@ -67,7 +67,7 @@ public async Task CorrelationManager_MutateStackPush() ValidateStack(Trace.CorrelationManager.LogicalOperationStack, 2, 1); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CorrelationManager_MutateStackPop() { Guid id = Guid.NewGuid(); @@ -82,7 +82,7 @@ public async Task CorrelationManager_MutateStackPop() ValidateStack(Trace.CorrelationManager.LogicalOperationStack, Array.Empty()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CorrelationManager_ActivityIdAcrossAwait() { Guid g = Guid.NewGuid(); @@ -94,7 +94,7 @@ public async Task CorrelationManager_ActivityIdAcrossAwait() Assert.Equal(g, Trace.CorrelationManager.ActivityId); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CorrelationManager_CorrelationAcrossAwait() { Guid g = Guid.NewGuid(); diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/ActivityTracking.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/ActivityTracking.cs index e975859721f929..361971b3b1243a 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/ActivityTracking.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/ActivityTracking.cs @@ -81,7 +81,7 @@ public async Task ActivityFlowsAsync() Assert.Equal(Guid.Empty, EventSource.CurrentThreadActivityId); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ActivityIdIsZeroedOnThreadSwitchOut() { using ActivityEventListener l = new ActivityEventListener(); diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs index 215ed94cb0bf78..7b60c4041eb872 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs +++ b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs @@ -1050,7 +1050,7 @@ public void FileSystemWatcher_File_Create_MultipleFilters() }, maxAttempts: DefaultAttemptsForExpectedEvent, backoffFunc: (iteration) => RetryDelayMilliseconds, retryWhen: e => e is XunitException); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/103584", TestPlatforms.Windows)] public void FileSystemWatcher_ModifyFiltersConcurrentWithEvents() { diff --git a/src/libraries/System.IO.Pipelines/tests/FlushAsyncCancellationTests.cs b/src/libraries/System.IO.Pipelines/tests/FlushAsyncCancellationTests.cs index a5a61579d9787c..fc9344f77bab66 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.IsMultithreadingSupported))] public void FlushAsyncCancellationDeadlock() { var cts = new CancellationTokenSource(); diff --git a/src/libraries/System.IO.Pipelines/tests/PipeReaderCopyToAsyncTests.cs b/src/libraries/System.IO.Pipelines/tests/PipeReaderCopyToAsyncTests.cs index 3c524de5122365..2615c051d97927 100644 --- a/src/libraries/System.IO.Pipelines/tests/PipeReaderCopyToAsyncTests.cs +++ b/src/libraries/System.IO.Pipelines/tests/PipeReaderCopyToAsyncTests.cs @@ -38,7 +38,7 @@ public async Task CopyToAsyncThrowsTaskCanceledExceptionForAlreadyCancelledToken await Assert.ThrowsAsync(() => PipeReader.CopyToAsync(new MemoryStream(), new CancellationToken(true))); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CopyToAsyncStreamWorks() { var messages = new List() @@ -170,7 +170,7 @@ public async Task CancelingThePendingReadThrowsOperationCancelledException() await Assert.ThrowsAsync(() => task); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CancelingBetweenReadsThrowsOperationCancelledException() { var stream = new WriteCheckMemoryStream { MidWriteCancellation = new CancellationTokenSource() }; @@ -193,7 +193,7 @@ public async Task CancelingViaCancellationTokenThrowsOperationCancelledException await Assert.ThrowsAsync(() => task); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CancelingPipeWriterViaCancellationTokenThrowsOperationCancelledException() { // This should make the write call pause @@ -207,7 +207,7 @@ public async Task CancelingPipeWriterViaCancellationTokenThrowsOperationCancelle await Assert.ThrowsAsync(() => task); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CancelingPipeWriterViaPendingFlushThrowsOperationCancelledException() { // This should make the write call pause @@ -220,7 +220,7 @@ public async Task CancelingPipeWriterViaPendingFlushThrowsOperationCancelledExce await Assert.ThrowsAsync(() => task); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CancelingStreamViaCancellationTokenThrowsOperationCancelledException() { var stream = new CancelledWritesStream(); @@ -261,7 +261,7 @@ public async Task ThrowingFromStreamDoesNotLeavePipeReaderInBrokenState() PipeReader.Complete(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0)] [InlineData(1)] public async Task ThrowingFromStreamCallsAdvanceToWithStartOfLastReadResult(int throwAfterNWrites) diff --git a/src/libraries/System.IO.Pipelines/tests/PipeReaderStreamTests.cs b/src/libraries/System.IO.Pipelines/tests/PipeReaderStreamTests.cs index 2e56e73d4a78f9..27a49c6e6888dc 100644 --- a/src/libraries/System.IO.Pipelines/tests/PipeReaderStreamTests.cs +++ b/src/libraries/System.IO.Pipelines/tests/PipeReaderStreamTests.cs @@ -15,7 +15,7 @@ public class PipeReaderStreamTests { public delegate Task ReadAsyncDelegate(Stream stream, byte[] data); - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task DisposingPipeReaderStreamCompletesPipeReader(bool dataInPipe) @@ -172,7 +172,7 @@ public async Task WritingToPipeReaderStreamThrowsNotSupported() pipe.Writer.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CancellingPendingReadThrowsOperationCancelledException() { var pipe = new Pipe(); @@ -188,7 +188,7 @@ public async Task CancellingPendingReadThrowsOperationCancelledException() pipe.Reader.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CanReadAfterCancellingPendingRead() { var pipe = new Pipe(); @@ -208,7 +208,7 @@ public async Task CanReadAfterCancellingPendingRead() pipe.Reader.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CancellationTokenFlowsToUnderlyingPipeReader() { var pipe = new Pipe(); @@ -246,7 +246,7 @@ public void AsStreamReturnsSameInstance() Assert.Same(stream, pipeReader.AsStream()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task PipeWriterStreamProducesToConsumingPipeReaderStream() { var pipe = new Pipe(); @@ -281,7 +281,7 @@ public async Task PipeWriterStreamProducesToConsumingPipeReaderStream() Assert.Equal(producedSum, consumedSum); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void ReadThrowsOriginalExceptionWhenItOccurs() { var pipeReader = new BuggyAndNotCompletedPipeReader(); @@ -438,7 +438,7 @@ public static IEnumerable ReadCalls yield return new object[] { readArrayAsync }; yield return new object[] { readMemoryAsync }; - if (PlatformDetection.IsThreadingSupported) + if (PlatformDetection.IsMultithreadingSupported) { yield return new object[] { readMemoryAsyncWithThreadHop }; } diff --git a/src/libraries/System.IO.Pipelines/tests/PipeReaderWriterFacts.cs b/src/libraries/System.IO.Pipelines/tests/PipeReaderWriterFacts.cs index 173f49856c1753..8eb1c66550ecfb 100644 --- a/src/libraries/System.IO.Pipelines/tests/PipeReaderWriterFacts.cs +++ b/src/libraries/System.IO.Pipelines/tests/PipeReaderWriterFacts.cs @@ -384,7 +384,7 @@ public async Task ReaderShouldNotGetUnflushedBytesWithAppend() _pipe.Reader.AdvanceTo(reader.Start, reader.Start); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(true)] [InlineData(false)] public async Task ReadAsyncOnCompletedCapturesTheExecutionContext(bool useSynchronizationContext) @@ -437,7 +437,7 @@ public async Task ReadAsyncOnCompletedCapturesTheExecutionContext(bool useSynchr } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(true)] [InlineData(false)] public async Task FlushAsyncOnCompletedCapturesTheExecutionContextAndSyncContext(bool useSynchronizationContext) @@ -491,7 +491,7 @@ public async Task FlushAsyncOnCompletedCapturesTheExecutionContextAndSyncContext } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ReadingCanBeCanceled() { var cts = new CancellationTokenSource(); diff --git a/src/libraries/System.IO.Pipelines/tests/PipeWriterCopyToAsyncTests.cs b/src/libraries/System.IO.Pipelines/tests/PipeWriterCopyToAsyncTests.cs index 9977b6d9349fa9..9da92dc151ab71 100644 --- a/src/libraries/System.IO.Pipelines/tests/PipeWriterCopyToAsyncTests.cs +++ b/src/libraries/System.IO.Pipelines/tests/PipeWriterCopyToAsyncTests.cs @@ -93,7 +93,7 @@ public async Task StreamCopyToAsyncWorks() pipe.Reader.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CancelingViaCancelPendingFlushThrows() { byte[] helloBytes = "Hello World"u8.ToArray(); @@ -112,7 +112,7 @@ public async Task CancelingViaCancelPendingFlushThrows() pipe.Reader.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CancelingViaCancellationTokenThrows() { byte[] helloBytes = "Hello World"u8.ToArray(); @@ -132,7 +132,7 @@ public async Task CancelingViaCancellationTokenThrows() pipe.Reader.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CancelingStreamViaCancellationTokenThrows() { var pipe = new Pipe(); diff --git a/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs b/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs index c7df5657c5d37d..c47633e62868e8 100644 --- a/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs +++ b/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs @@ -15,7 +15,7 @@ public class PipeWriterStreamTests { public delegate Task WriteAsyncDelegate(Stream stream, byte[] data); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task DisposingPipeWriterStreamCompletesPipeWriter() { var pipe = new Pipe(); @@ -118,7 +118,7 @@ public async Task ReadingFromPipeWriterStreamThrowsNotSupported() pipe.Writer.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CancellingPendingFlushThrowsOperationCancelledException() { var pipe = new Pipe(new PipeOptions(pauseWriterThreshold: 10, resumeWriterThreshold: 0)); @@ -135,7 +135,7 @@ public async Task CancellingPendingFlushThrowsOperationCancelledException() pipe.Reader.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CancellationTokenFlowsToUnderlyingPipeWriter() { var pipe = new Pipe(new PipeOptions(pauseWriterThreshold: 10, resumeWriterThreshold: 0)); diff --git a/src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs b/src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs index 51f206ebf1cdcd..e7b13343cf677b 100644 --- a/src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs +++ b/src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs @@ -293,7 +293,7 @@ public async Task WritesUsingGetMemoryWorks() pipe.Reader.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CompleteWithLargeWriteThrows() { var completeDelay = TimeSpan.FromMilliseconds(10); diff --git a/src/libraries/System.IO.Pipelines/tests/ReadAsyncCancellationTests.cs b/src/libraries/System.IO.Pipelines/tests/ReadAsyncCancellationTests.cs index fb17873b6a1c56..8aad16fbc94eab 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.IsMultithreadingSupported))] public void ReadAsyncCancellationDeadlock() { var cts = new CancellationTokenSource(); @@ -385,7 +385,7 @@ public async Task ReadAsyncWithNewCancellationTokenNotAffectedByPrevious() Pipe.Reader.AdvanceTo(result.Buffer.Start); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ReadingCanBeCanceled() { var cts = new CancellationTokenSource(); diff --git a/src/libraries/System.IO.Pipelines/tests/SchedulerFacts.cs b/src/libraries/System.IO.Pipelines/tests/SchedulerFacts.cs index ba558339b0a057..3674f34b773c0c 100644 --- a/src/libraries/System.IO.Pipelines/tests/SchedulerFacts.cs +++ b/src/libraries/System.IO.Pipelines/tests/SchedulerFacts.cs @@ -44,7 +44,7 @@ private void Work(object state) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task UseSynchronizationContextFalseIgnoresSyncContextForReaderScheduler() { SynchronizationContext previous = SynchronizationContext.Current; @@ -88,7 +88,7 @@ public async Task UseSynchronizationContextFalseIgnoresSyncContextForReaderSched } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task DefaultReaderSchedulerRunsOnSynchronizationContext() { SynchronizationContext previous = SynchronizationContext.Current; @@ -132,7 +132,7 @@ public async Task DefaultReaderSchedulerRunsOnSynchronizationContext() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task DefaultReaderSchedulerIgnoresSyncContextIfConfigureAwaitFalse() { // Get off the xunit sync context @@ -180,7 +180,7 @@ public async Task DefaultReaderSchedulerIgnoresSyncContextIfConfigureAwaitFalse( } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task DefaultReaderSchedulerRunsOnThreadPool() { var pipe = new Pipe(new PipeOptions(useSynchronizationContext: false)); @@ -209,7 +209,7 @@ public async Task DefaultReaderSchedulerRunsOnThreadPool() await reading; } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task DefaultWriterSchedulerRunsOnThreadPool() { using (var pool = new TestMemoryPool()) @@ -250,7 +250,7 @@ public async Task DefaultWriterSchedulerRunsOnThreadPool() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task UseSynchronizationContextFalseIgnoresSyncContextForWriterScheduler() { SynchronizationContext previous = SynchronizationContext.Current; @@ -357,7 +357,7 @@ public async Task DefaultWriterSchedulerRunsOnSynchronizationContext() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task DefaultWriterSchedulerIgnoresSynchronizationContext() { SynchronizationContext previous = SynchronizationContext.Current; @@ -410,7 +410,7 @@ public async Task DefaultWriterSchedulerIgnoresSynchronizationContext() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task FlushCallbackRunsOnWriterScheduler() { using (var pool = new TestMemoryPool()) @@ -455,7 +455,7 @@ public async Task FlushCallbackRunsOnWriterScheduler() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ReadAsyncCallbackRunsOnReaderScheduler() { using (var pool = new TestMemoryPool()) @@ -488,7 +488,7 @@ public async Task ReadAsyncCallbackRunsOnReaderScheduler() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ThreadPoolScheduler_SchedulesOnThreadPool() { var pipe = new Pipe(new PipeOptions(readerScheduler: PipeScheduler.ThreadPool, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false)); diff --git a/src/libraries/System.IO.Pipelines/tests/StreamPipeReaderTests.cs b/src/libraries/System.IO.Pipelines/tests/StreamPipeReaderTests.cs index 9fa3e33945b932..bd8b8f0ca82c4c 100644 --- a/src/libraries/System.IO.Pipelines/tests/StreamPipeReaderTests.cs +++ b/src/libraries/System.IO.Pipelines/tests/StreamPipeReaderTests.cs @@ -67,7 +67,7 @@ public async Task TryReadReturnsFalseIfBufferedBytesAndEverythingExamined() reader.Complete(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task CanReadMultipleTimes(bool useZeroByteReads) @@ -278,7 +278,7 @@ public void TryReadAfterCancelPendingReadReturnsTrue() reader.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ReadCanBeCancelledViaProvidedCancellationToken() { var stream = new CancelledReadsStream(); @@ -299,7 +299,7 @@ public async Task ReadCanBeCancelledViaProvidedCancellationToken() reader.Complete(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task ReadCanBeCanceledViaCancelPendingReadWhenReadAsync(bool useZeroByteReads) @@ -318,7 +318,7 @@ public async Task ReadCanBeCanceledViaCancelPendingReadWhenReadAsync(bool useZer reader.Complete(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task ReadCanBeCanceledViaCancelPendingReadWhenReadAtLeastAsync(bool useZeroByteReads) diff --git a/src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs b/src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs index 3a812857822df6..8c7225b28539f7 100644 --- a/src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs +++ b/src/libraries/System.IO.Pipelines/tests/StreamPipeWriterTests.cs @@ -192,7 +192,7 @@ public async Task WritesUsingGetMemoryWorks() Assert.Equal(0, writer.UnflushedBytes); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CanDoMultipleAsyncWritesToStream() { var pipe = new Pipe(); @@ -248,7 +248,7 @@ async Task DoReadsAsync(PipeReader reader, byte[][] reads) await readsTask; } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CanCancelFlushAsyncWithCancellationTokenStreamFlushAsyncThrows() { var stream = new CancelledWritesStream(); @@ -269,7 +269,7 @@ public async Task CanCancelFlushAsyncWithCancellationTokenStreamFlushAsyncThrows writer.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CanCancelFlushAsyncWithCancellationTokenWhenStreamWriteAsyncThrows() { var stream = new CancelledWritesStream(); @@ -290,7 +290,7 @@ public async Task CanCancelFlushAsyncWithCancellationTokenWhenStreamWriteAsyncTh writer.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CanCancelFlushAsyncWithCancelPendingFlushStreamFlushAsyncThrows() { var stream = new CancelledWritesStream(); @@ -311,7 +311,7 @@ public async Task CanCancelFlushAsyncWithCancelPendingFlushStreamFlushAsyncThrow writer.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CanCancelFlushAsyncWithCancelPendingFlushStreamWriteAsyncThrows() { var stream = new CancelledWritesStream(); @@ -332,7 +332,7 @@ public async Task CanCancelFlushAsyncWithCancelPendingFlushStreamWriteAsyncThrow writer.Complete(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task StreamWriteAsyncThrowingDoesNotReturnMemoryToPool() { using (var pool = new DisposeTrackingBufferPool()) @@ -358,7 +358,7 @@ public async Task StreamWriteAsyncThrowingDoesNotReturnMemoryToPool() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task StreamFlushAsyncThrowingDoesReturnMemoryToPool() { using (var pool = new DisposeTrackingBufferPool()) diff --git a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs index 2b6421d1f09a23..8ae58d74c23075 100644 --- a/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs +++ b/src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.Specific.cs @@ -46,7 +46,7 @@ await Assert.ThrowsAsync(() => } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] public async Task CancelConnectToNonExistentServer_Throws_OperationCanceledException() { @@ -574,7 +574,7 @@ public void InvalidReadMode_Throws_ArgumentOutOfRangeException(PipeDirection ser } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [PlatformSpecific(TestPlatforms.AnyUnix)] // Checks MaxLength for PipeName on Unix [SkipOnPlatform(TestPlatforms.LinuxBionic, "SElinux blocks UNIX sockets in our CI environment")] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "iOS/tvOS blocks binding to UNIX sockets")] diff --git a/src/libraries/System.Linq.Expressions/tests/Dynamic/CallSiteCachingTests.cs b/src/libraries/System.Linq.Expressions/tests/Dynamic/CallSiteCachingTests.cs index cc829df8a32864..6f29ddba762666 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.IsMultithreadingSupported))] public void ConcurrentAdds() { for (int i = 0; i < 10; i++) diff --git a/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs b/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs index 48b88769467f51..e00496baf037a3 100644 --- a/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs +++ b/src/libraries/System.Linq.Parallel/src/System/Linq/ParallelEnumerable.cs @@ -18,6 +18,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq.Parallel; +using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Threading; using System.Threading.Tasks; @@ -68,11 +69,7 @@ public static class ParallelEnumerable [SupportedOSPlatformGuard("browser")] [SupportedOSPlatformGuard("wasi")] -#if FEATURE_SINGLE_THREADED - internal static bool SinglePartitionMode => true; -#else - internal static bool SinglePartitionMode => false; -#endif + internal static bool SinglePartitionMode => !RuntimeFeature.IsMultithreadingSupported; //----------------------------------------------------------------------------------- // Converts any IEnumerable into something that can be the target of parallel diff --git a/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs b/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs index 6dcaffbf60a5a5..b4920ff44bce1d 100644 --- a/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs @@ -92,9 +92,9 @@ public static IEnumerable AllMergeOptions_Multiple() [MemberData(nameof(PartitioningData), new[] { 0, 1, 2, 16, 1024 })] public static void Partitioning_Default(Labeled> labeled, int count, int partitions) { - if (partitions > 1 && !PlatformDetection.IsThreadingSupported) + if (partitions > 1 && !PlatformDetection.IsMultithreadingSupported) { - throw new SkipTestException(nameof(PlatformDetection.IsThreadingSupported)); + throw new SkipTestException(nameof(PlatformDetection.IsMultithreadingSupported)); } _ = count; @@ -117,9 +117,9 @@ public static void Partitioning_Default_Longrunning(Labeled> [MemberData(nameof(PartitioningData), new[] { 0, 1, 2, 16, 1024 })] public static void Partitioning_Striped(Labeled> labeled, int count, int partitions) { - if (partitions > 1 && !PlatformDetection.IsThreadingSupported) + if (partitions > 1 && !PlatformDetection.IsMultithreadingSupported) { - throw new SkipTestException(nameof(PlatformDetection.IsThreadingSupported)); + throw new SkipTestException(nameof(PlatformDetection.IsMultithreadingSupported)); } int seen = 0; @@ -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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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) @@ -207,7 +207,7 @@ public static void Merge_ArgumentNullException() // 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.IsMultithreadingSupported))] [MemberData(nameof(UnorderedSources.BinaryRanges), new[] { 16 }, new[] { 16 }, MemberType = typeof(UnorderedSources))] public static void PlinqChunkPartitioner_DontEnumerateAfterException( Labeled> left, int leftCount, @@ -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.IsMultithreadingSupported))] [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..67e09f0456232c 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.IsMultithreadingSupported))] [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..952b806cd23564 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.IsMultithreadingSupported))] 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..44fdef9ace722c 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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 6427f2758c3bb2..aa762de8619f5e 100644 --- a/src/libraries/System.Linq/tests/SelectTests.cs +++ b/src/libraries/System.Linq/tests/SelectTests.cs @@ -102,7 +102,7 @@ public void EmptyWithIndexedSelector() Assert.Equal([], Enumerable.Empty().Select((s, i) => s.Length + i)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void EnumerateFromDifferentThread() { var selected = Enumerable.Range(0, 100).Where(i => i > 3).Select(i => i.ToString()); diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs index 50f237a1dac7ed..949649ebf46141 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/HttpClientTest.cs @@ -1534,7 +1534,7 @@ public enum ExceptionScenario public static IEnumerable Send_InnerHandlerThrows_OuterExceptionIsCaptured_MemberData() => Enum.GetValues().Select(e => new object[] { e }); - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(Send_InnerHandlerThrows_OuterExceptionIsCaptured_MemberData))] public async Task Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured(ExceptionScenario scenario) { diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs index a70230c3ec9808..c04503f91f029f 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs @@ -1302,7 +1302,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri => }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task RequestDuration_ConcurrentRequestsSeeDifferentContexts() { await LoopbackServerFactory.CreateClientAndServerAsync(async uri => diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostAddressesTest.cs b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostAddressesTest.cs index 346156b81a93ac..b91219cf6fed19 100644 --- a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostAddressesTest.cs +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostAddressesTest.cs @@ -69,14 +69,14 @@ public async Task Dns_GetHostAddressesAsync_NullHost_Fail() await Assert.ThrowsAsync(() => Dns.GetHostAddressesAsync(null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void DnsBeginGetHostAddresses_BadName_Throws() { IAsyncResult asyncObject = Dns.BeginGetHostAddresses("BadName", null, null); Assert.ThrowsAny(() => Dns.EndGetHostAddresses(asyncObject)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void DnsBeginGetHostAddresses_BadIpString_ReturnsAddress() { IAsyncResult asyncObject = Dns.BeginGetHostAddresses("0.0.1.1", null, null); @@ -86,7 +86,7 @@ public void DnsBeginGetHostAddresses_BadIpString_ReturnsAddress() Assert.Equal(IPAddress.Parse("0.0.1.1"), results[0]); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void DnsBeginGetHostAddresses_MachineName_MatchesGetHostAddresses() { IAsyncResult asyncObject = Dns.BeginGetHostAddresses(TestSettings.LocalHost, null, null); diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostByNameTest.cs b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostByNameTest.cs index 479a5cd39ac350..5e98b7e04b7c99 100644 --- a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostByNameTest.cs +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostByNameTest.cs @@ -12,14 +12,14 @@ namespace System.Net.NameResolution.Tests { public class GetHostByNameTest { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void DnsObsoleteBeginGetHostByName_BadName_Throws() { IAsyncResult asyncObject = Dns.BeginGetHostByName("BadName", null, null); Assert.ThrowsAny(() => Dns.EndGetHostByName(asyncObject)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void DnsObsoleteBeginGetHostByName_IPv4String_ReturnsOnlyGivenIP() { IAsyncResult asyncObject = Dns.BeginGetHostByName(IPAddress.Loopback.ToString(), null, null); @@ -30,7 +30,7 @@ public void DnsObsoleteBeginGetHostByName_IPv4String_ReturnsOnlyGivenIP() Assert.Equal(IPAddress.Loopback, entry.AddressList[0]); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void DnsObsoleteBeginGetHostByName_MachineNameWithIPv4_MatchesGetHostByName() { IAsyncResult asyncObject = Dns.BeginGetHostByName(TestSettings.LocalHost, null, null); @@ -115,7 +115,7 @@ public void DnsObsoleteGetHostByName_EmptyString_ReturnsHostName() Assert.Contains(Dns.GetHostName(), entry.HostName, StringComparison.OrdinalIgnoreCase); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotArm64Process), nameof(PlatformDetection.IsThreadingSupported))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/27622")] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotArm64Process), nameof(PlatformDetection.IsMultithreadingSupported))] // [ActiveIssue("https://github.com/dotnet/runtime/issues/27622")] [ActiveIssue("https://github.com/dotnet/runtime/issues/1488", TestPlatforms.OSX)] [ActiveIssue("https://github.com/dotnet/runtime/issues/51377", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void DnsObsoleteBeginEndGetHostByName_EmptyString_ReturnsHostName() diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs index f1c05339fe2753..9ea1e7caca4c78 100644 --- a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/GetHostEntryTest.cs @@ -15,7 +15,7 @@ namespace System.Net.NameResolution.Tests { public class GetHostEntryTest { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Dns_GetHostEntryAsync_IPAddress_Ok() { IPAddress localIPAddress = await TestSettings.GetLocalIPAddress(); @@ -154,7 +154,7 @@ public async Task Dns_GetHostEntry_NullStringHost_Fail() await Assert.ThrowsAsync(() => Dns.GetHostEntryAsync((string)null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Dns_GetHostEntry_NullStringHost_Fail_Obsolete() { await Assert.ThrowsAsync(() => Task.Factory.FromAsync(Dns.BeginGetHostEntry, Dns.EndGetHostEntry, (string)null, null)); @@ -191,7 +191,7 @@ public async Task Dns_GetHostEntry_AnyIPAddress_Fail(IPAddress address) await Assert.ThrowsAsync(() => Task.Factory.FromAsync(Dns.BeginGetHostEntry, Dns.EndGetHostEntry, address.ToString(), null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task DnsGetHostEntry_MachineName_AllVariationsMatch() { IPHostEntry syncResult = Dns.GetHostEntry(TestSettings.LocalHost); @@ -246,7 +246,7 @@ public async Task DnsGetHostEntry_BadName_ThrowsArgumentOutOfRangeException(stri await Assert.ThrowsAnyAsync(() => Dns.GetHostEntryAsync(hostNameOrAddress)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData("Really.Long.Name.Over.One.Hundred.And.Twenty.Six.Chars.Eeeeeeeventualllllllly.I.Will.Get.To.The.Eeeee" + "eeeeend.Almost.There.Are.We.Really.Long.Name.Over.One.Hundred.And.Twenty.Six.Chars.Eeeeeeeventualll" + "llllly.I.Will.Get.To.The.Eeeeeeeeeend.Almost.There.Aret")] @@ -276,7 +276,7 @@ public async Task DnsGetHostEntry_LocalHost_ReturnsFqdnAndLoopbackIPs(int mode) Assert.All(entry.AddressList, addr => Assert.True(IPAddress.IsLoopback(addr), "Not a loopback address: " + addr)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(2)] diff --git a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/ResolveTest.cs b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/ResolveTest.cs index 814ec5cc6c2679..b9eb088bb3e105 100644 --- a/src/libraries/System.Net.NameResolution/tests/FunctionalTests/ResolveTest.cs +++ b/src/libraries/System.Net.NameResolution/tests/FunctionalTests/ResolveTest.cs @@ -10,14 +10,14 @@ namespace System.Net.NameResolution.Tests { public class ResolveTest { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void DnsObsoleteBeginResolve_BadName_Throws() { IAsyncResult asyncObject = Dns.BeginResolve("BadName", null, null); Assert.ThrowsAny(() => Dns.EndResolve(asyncObject)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void DnsObsoleteBeginResolve_BadIPv4String_ReturnsOnlyGivenIP() { IAsyncResult asyncObject = Dns.BeginResolve("0.0.1.1", null, null); @@ -28,7 +28,7 @@ public void DnsObsoleteBeginResolve_BadIPv4String_ReturnsOnlyGivenIP() Assert.Equal(IPAddress.Parse("0.0.1.1"), entry.AddressList[0]); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void DnsObsoleteBeginResolve_Loopback_MatchesResolve() { IAsyncResult asyncObject = Dns.BeginResolve(IPAddress.Loopback.ToString(), null, null); diff --git a/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs b/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs index 06e0c97ebc12d3..add14868a201b7 100644 --- a/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs +++ b/src/libraries/System.Net.Ping/tests/FunctionalTests/PingTest.cs @@ -82,7 +82,7 @@ private static byte[] GetPingPayload(AddressFamily addressFamily) Capability.CanUseRawSockets(TestSettings.GetLocalIPAddress().AddressFamily); public static bool UsesPingUtility => !DoesNotUsePingUtility; - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendPingAsync_InvalidArgs() { IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync(); @@ -153,7 +153,7 @@ public void SendPingWithIPAddress(AddressFamily addressFamily) }); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(AddressFamily.InterNetwork)] [InlineData(AddressFamily.InterNetworkV6)] public async Task SendPingAsyncWithIPAddress(AddressFamily addressFamily) @@ -193,7 +193,7 @@ public void SendPingWithIPAddress_AddressAsString(AddressFamily addressFamily) }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendPingAsyncWithIPAddress_AddressAsString() { IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync(); @@ -219,7 +219,7 @@ public void SendPingWithIPAddressAndTimeout() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendPingAsyncWithIPAddressAndTimeout() { IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync(); @@ -247,7 +247,7 @@ public void SendPingWithIPAddressAndTimeoutAndBuffer() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendPingAsyncWithIPAddressAndTimeoutAndBuffer() { IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync(); @@ -281,7 +281,7 @@ public void SendPingWithIPAddressAndTimeoutAndBufferAndPingOptions() } [PlatformSpecific(TestPlatforms.Windows)] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendPingAsyncWithIPAddressAndTimeoutAndBufferAndPingOptions() { IPAddress localIpAddress = await TestSettings.GetLocalIPAddressAsync(); @@ -323,7 +323,7 @@ public void SendPingWithIPAddressAndTimeoutAndBufferAndPingOptions_Unix(AddressF } [PlatformSpecific(TestPlatforms.AnyUnix)] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(AddressFamily.InterNetwork)] [InlineData(AddressFamily.InterNetworkV6)] public async Task SendPingAsyncWithIPAddressAndTimeoutAndBufferAndPingOptions_Unix(AddressFamily addressFamily) @@ -359,7 +359,7 @@ public void SendPingWithHost() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendPingAsyncWithHost() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -385,7 +385,7 @@ public void SendPingWithHostAndTimeout() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendPingAsyncWithHostAndTimeout() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -413,7 +413,7 @@ public void SendPingWithHostAndTimeoutAndBuffer() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendPingAsyncWithHostAndTimeoutAndBuffer() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -443,7 +443,7 @@ public void SendPingWithHostAndTimeoutAndBufferAndPingOptions() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendPingAsyncWithHostAndTimeoutAndBufferAndPingOptions() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -482,7 +482,7 @@ public async Task SendPingWithIPAddressAndBigSize() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendPings_ReuseInstance_Hostname() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -497,7 +497,7 @@ public async Task SendPings_ReuseInstance_Hostname() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Sends_ReuseInstance_Hostname() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -512,7 +512,7 @@ public async Task Sends_ReuseInstance_Hostname() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendAsyncs_ReuseInstance_Hostname() { IPAddress[] localIpAddresses = await TestSettings.GetLocalIPAddressesAsync(); @@ -570,7 +570,7 @@ public static void Ping_DisposeAfterSend_Success() p.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static async Task PingAsync_DisposeAfterSend_Success() { Ping p = new Ping(); @@ -644,7 +644,7 @@ public void CanBeFinalized() Assert.True(FinalizingPing.WasFinalized); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(true)] [InlineData(false)] public async Task SendPingAsyncWithHostAndTtlAndFragmentPingOptions(bool fragment) @@ -664,7 +664,7 @@ await SendBatchPingAsync( }); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(true)] [InlineData(false)] public async Task SendPingAsyncWithAlreadyCanceledToken(bool useIPAddress) @@ -686,7 +686,7 @@ public async Task SendPingAsyncWithAlreadyCanceledToken(bool useIPAddress) Assert.Equal(IPStatus.Success, reply.Status); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] [OuterLoop("Depends on external host.")] @@ -708,7 +708,7 @@ public async Task CancelSendPingAsync_HostName(bool useCancellationToken) Assert.True(pingTask.IsCanceled); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] [OuterLoop("Depends on external host and runs long on Windows.")] @@ -754,7 +754,7 @@ async Task TestCore(string unreachableIPString) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] // Depends on external host and assumption that network respects and does not change TTL public async Task SendPingToExternalHostWithLowTtlTest() { diff --git a/src/libraries/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs b/src/libraries/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs index 40c8485ec813c3..84ac53d41b5042 100644 --- a/src/libraries/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs +++ b/src/libraries/System.Net.Ping/tests/FunctionalTests/UnixPingUtilityTests.cs @@ -55,7 +55,7 @@ public static void TimeoutIsRespected(int timeout) Assert.InRange(stopWatch.ElapsedMilliseconds, timeout - 10, 5000); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(50)] diff --git a/src/libraries/System.Net.Primitives/tests/UnitTests/CookieContainerTest.cs b/src/libraries/System.Net.Primitives/tests/UnitTests/CookieContainerTest.cs index 050024fd0a0592..3608e37d7c685d 100644 --- a/src/libraries/System.Net.Primitives/tests/UnitTests/CookieContainerTest.cs +++ b/src/libraries/System.Net.Primitives/tests/UnitTests/CookieContainerTest.cs @@ -534,7 +534,7 @@ public void Add_ReachedMaxCount_NotAdded() Assert.Equal(4, cc.Count); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Add_ReachedMaxCountWithExpiredCookies_Added() { Cookie c1 = new Cookie("name1", "value", "", ".domain1.com"); @@ -694,7 +694,7 @@ public void GetCookies_DifferentPaths_ReturnsConsistentResults() Assert.Equal(c1, cc3[1]); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task GetCookies_RemovesExpired_Cookies() { Cookie c1 = new Cookie("name1", "value", "", ".url1.com"); diff --git a/src/libraries/System.Net.Security/tests/UnitTests/SslStreamAllowedProtocolsTest.cs b/src/libraries/System.Net.Security/tests/UnitTests/SslStreamAllowedProtocolsTest.cs index 97f98d272253cb..7bbd37d5918487 100644 --- a/src/libraries/System.Net.Security/tests/UnitTests/SslStreamAllowedProtocolsTest.cs +++ b/src/libraries/System.Net.Security/tests/UnitTests/SslStreamAllowedProtocolsTest.cs @@ -17,7 +17,7 @@ protected abstract void AuthenticateAsClient( SslStream stream, bool waitForCompletion, string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation); - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ClassData(typeof(SslProtocolSupport.SupportedSslProtocolsTestData))] public void SslStream_AuthenticateAsClientAsync_Supported_Success(SslProtocols protocol) { @@ -25,7 +25,7 @@ public void SslStream_AuthenticateAsClientAsync_Supported_Success(SslProtocols p AuthenticateAsClient(stream, true, "host", null, protocol, false); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ClassData(typeof(SslProtocolSupport.SupportedSslProtocolsTestData))] public void SslStream_AuthenticateAsClient_Supported_Success(SslProtocols protocol) { @@ -33,21 +33,21 @@ public void SslStream_AuthenticateAsClient_Supported_Success(SslProtocols protoc AuthenticateAsClient(stream, true, "host", null, protocol, false); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void SslStream_AuthenticateAsClientAsync_AllSupported_Success() { SslStream stream = new SslStream(new NotImplementedStream()); AuthenticateAsClient(stream, true, "host", null, SslProtocolSupport.SupportedSslProtocols, false); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void SslStream_AuthenticateAsClientAsync_None_Success() { SslStream stream = new SslStream(new NotImplementedStream()); AuthenticateAsClient(stream, true, "host", null, SslProtocols.None, false); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void SslStream_AuthenticateAsClientAsync_Default_Success() { SslStream stream = new SslStream(new NotImplementedStream()); diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Accept.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Accept.cs index d71a8737da4606..3356a5ac3b7f05 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Accept.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Accept.cs @@ -144,7 +144,7 @@ public async Task Accept_ConcurrentAcceptsAfterConnects_Success(int numberAccept } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Accept_WithTargetSocket_Success() { if (!SupportsAcceptIntoExistingSocket) @@ -167,7 +167,7 @@ public async Task Accept_WithTargetSocket_Success() } [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task Accept_WithTargetSocket_ReuseAfterDisconnect_Success(bool reuseSocket) @@ -239,7 +239,7 @@ public async Task Accept_WithAlreadyBoundTargetSocket_Fails() } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Accept_WithInUseTargetSocket_Fails() { if (!SupportsAcceptIntoExistingSocket) @@ -353,7 +353,7 @@ await RetryHelper.ExecuteAsync(async () => }, maxAttempts: 10, retryWhen: e => e is XunitException); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task AcceptReceive_Success() { if (!SupportsAcceptReceive) @@ -378,19 +378,19 @@ public async Task AcceptReceive_Success() } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class AcceptSync : Accept { public AcceptSync(ITestOutputHelper output) : base(output) {} } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class AcceptSyncForceNonBlocking : Accept { public AcceptSyncForceNonBlocking(ITestOutputHelper output) : base(output) {} } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class AcceptApm : Accept { public AcceptApm(ITestOutputHelper output) : base(output) {} diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/AgnosticListenerTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/AgnosticListenerTest.cs index fd0d0831608991..dd28858dee8497 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/AgnosticListenerTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/AgnosticListenerTest.cs @@ -31,7 +31,7 @@ public void Create_Success() } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ConnectWithV4_Success() { TcpListener listener = SocketTestExtensions.CreateAndStartTcpListenerOnAnonymousPort(out int port); @@ -48,7 +48,7 @@ public async Task ConnectWithV4_Success() } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ConnectWithV6_Success() { TcpListener listener = SocketTestExtensions.CreateAndStartTcpListenerOnAnonymousPort(out int port); @@ -65,7 +65,7 @@ public async Task ConnectWithV6_Success() } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ConnectWithV4AndV6_Success() { TcpListener listener = SocketTestExtensions.CreateAndStartTcpListenerOnAnonymousPort(out int port); diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/ArgumentValidationTests.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/ArgumentValidationTests.cs index dfe800ad999696..33f74f47df3c3f 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/ArgumentValidationTests.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/ArgumentValidationTests.cs @@ -11,7 +11,7 @@ namespace System.Net.Sockets.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public class ArgumentValidation { // This type is used to test Socket.Select's argument validation. diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Connect.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Connect.cs index b295a05b7b6397..7160159bdf9e38 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Connect.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Connect.cs @@ -18,7 +18,7 @@ namespace System.Net.Sockets.Tests public Connect(ITestOutputHelper output) : base(output) {} [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // async SocketTestServer requires threads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // async SocketTestServer requires threads [MemberData(nameof(Loopbacks))] public async Task Connect_Success(IPAddress listenAt) { @@ -46,7 +46,7 @@ public async Task Connect_Udp_Success(IPAddress listenAt) Assert.True(client.Connected); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // async SocketTestServer requires threads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // async SocketTestServer requires threads [MemberData(nameof(Loopbacks))] public async Task Connect_Dns_Success(IPAddress listenAt) { @@ -69,7 +69,7 @@ public async Task Connect_Dns_Success(IPAddress listenAt) } [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // async SocketTestServer requires threads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // async SocketTestServer requires threads [MemberData(nameof(Loopbacks))] public async Task Connect_MultipleIPAddresses_Success(IPAddress listenAt) { @@ -86,7 +86,7 @@ public async Task Connect_MultipleIPAddresses_Success(IPAddress listenAt) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // async SocketTestServer requires threads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // async SocketTestServer requires threads public async Task Connect_OnConnectedSocket_Fails() { int port; @@ -103,7 +103,7 @@ public async Task Connect_OnConnectedSocket_Fails() [PlatformSpecific(TestPlatforms.Windows)] // Unix currently does not support Disconnect [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // async SocketTestServer requires threads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // async SocketTestServer requires threads public async Task Connect_AfterDisconnect_Fails() { int port; @@ -482,19 +482,19 @@ private async Task MultiConnectTestImpl(bool dnsConnect, Action setupSoc } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ConnectSync : Connect { public ConnectSync(ITestOutputHelper output) : base(output) {} } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ConnectSyncForceNonBlocking : Connect { public ConnectSyncForceNonBlocking(ITestOutputHelper output) : base(output) {} } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ConnectApm : Connect { public ConnectApm(ITestOutputHelper output) : base(output) {} @@ -509,7 +509,7 @@ public sealed class ConnectEap : Connect { public ConnectEap(ITestOutputHelper output) : base(output) {} - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(true)] [InlineData(false)] public async Task ConnectAsync_WithData_DataReceived(bool useArrayApi) @@ -728,7 +728,7 @@ protected Connect_NonParallel(ITestOutputHelper output) : base(output) { } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // async SocketTestServer requires threads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // async SocketTestServer requires threads public async Task Connect_DualMode_MultiAddressFamilyConnect_RetrievedEndPoints_Success() { if (!SupportsMultiConnect) @@ -747,7 +747,7 @@ public async Task Connect_DualMode_MultiAddressFamilyConnect_RetrievedEndPoints_ } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // async SocketTestServer requires threads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // async SocketTestServer requires threads public async Task Connect_DualMode_DnsConnect_RetrievedEndPoints_Success() { var localhostAddresses = Dns.GetHostAddresses("localhost"); @@ -783,13 +783,13 @@ public sealed class ConnectSync_NonParallel : Connect_NonParallel { public ConnectSyncForceNonBlocking_NonParallel(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ConnectApm_NonParallel : Connect_NonParallel { public ConnectApm_NonParallel(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/CreateSocketTests.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/CreateSocketTests.cs index 22737d013c22ef..7d683879973147 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/CreateSocketTests.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/CreateSocketTests.cs @@ -460,7 +460,7 @@ public async Task Ctor_SafeHandle_Tcp_SendReceive_Success(AddressFamily addressF Assert.Equal(42, buffer[0]); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] [ActiveIssue("https://github.com/dotnet/runtime/issues/52124", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/DisconnectTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/DisconnectTest.cs index a96920b5c63779..b35eedaa3fa6dc 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/DisconnectTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/DisconnectTest.cs @@ -13,7 +13,7 @@ namespace System.Net.Sockets.Tests { protected Disconnect(ITestOutputHelper output) : base(output) { } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // async SocketTestServer requires threads + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // async SocketTestServer requires threads [InlineData(true)] [InlineData(false)] public async Task Disconnect_Success(bool reuseSocket) @@ -50,7 +50,7 @@ public async Task Disconnect_Success(bool reuseSocket) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task DisconnectAndReuse_SameHost_Succeeds() { // After DisconnectAsync(reuseSocket: true), reconnecting to the same @@ -109,7 +109,7 @@ public async Task DisconnectAndReuse_SameHost_Succeeds() Assert.Equal(message, serverRecvBuf[..totalReceived]); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // async SocketTestServer requires threads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // async SocketTestServer requires threads public async Task DisconnectAndReuse_ReconnectSync_ThrowsInvalidOperationException() { IPEndPoint loopback = new IPEndPoint(IPAddress.Loopback, 0); @@ -156,19 +156,19 @@ public async Task Disconnect_ObjectDisposed_ThrowsObjectDisposedException(bool r } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class Disconnect_Sync : Disconnect { public Disconnect_Sync(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class Disconnect_SyncForceNonBlocking : Disconnect { public Disconnect_SyncForceNonBlocking(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class Disconnect_Apm : Disconnect { public Disconnect_Apm(ITestOutputHelper output) : base(output) { } @@ -193,7 +193,7 @@ public sealed class Disconnect_CancellableTask : Disconnect { public LocalEndPointTestIPv4Sync(ITestOutputHelper output) : base(output) { } } [Trait("IPv4", "true")] - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class LocalEndPointTestIPv4SyncForceNonBlocking : LocalEndPointTestIPv4 { public LocalEndPointTestIPv4SyncForceNonBlocking(ITestOutputHelper output) : base(output) { } } [Trait("IPv4", "true")] - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class LocalEndPointTestIPv4Apm : LocalEndPointTestIPv4 { public LocalEndPointTestIPv4Apm(ITestOutputHelper output) : base(output) { } @@ -280,21 +280,21 @@ public LocalEndPointTestIPv4Eap(ITestOutputHelper output) : base(output) { } } [Trait("IPv6", "true")] - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class LocalEndPointTestIPv6Sync : LocalEndPointTestIPv6 { public LocalEndPointTestIPv6Sync(ITestOutputHelper output) : base(output) { } } [Trait("IPv6", "true")] - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class LocalEndPointTestIPv6SyncForceNonBlocking : LocalEndPointTestIPv6 { public LocalEndPointTestIPv6SyncForceNonBlocking(ITestOutputHelper output) : base(output) { } } [Trait("IPv6", "true")] - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class LocalEndPointTestIPv6Apm : LocalEndPointTestIPv6 { public LocalEndPointTestIPv6Apm(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs index f4e51b061a86fc..63b862f355b39a 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/NetworkStreamTest.cs @@ -565,7 +565,7 @@ private static async Task RunWithConnectedNetworkStreamsAsync(Func { public ReceiveFrom_Sync(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ReceiveFrom_SyncForceNonBlocking : ReceiveFrom { public ReceiveFrom_SyncForceNonBlocking(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ReceiveFrom_Apm : ReceiveFrom { public ReceiveFrom_Apm(ITestOutputHelper output) : base(output) { } @@ -477,7 +477,7 @@ public void EndReceiveFrom_AddressFamilyDoesNotMatch_Throws_ArgumentException() Assert.Throws("endPoint", () => socket.EndReceiveFrom(iar, ref invalidEndPoint)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/54418", TestPlatforms.MacCatalyst)] public void BeginReceiveFrom_RemoteEpIsReturnedWhenCompletedSynchronously() { @@ -546,13 +546,13 @@ public void ReceiveFromAsync_NullAsyncEventArgs_Throws_ArgumentNullException() } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ReceiveFrom_SpanSync : ReceiveFrom { public ReceiveFrom_SpanSync(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ReceiveFrom_SpanSyncForceNonBlocking : ReceiveFrom { public ReceiveFrom_SpanSyncForceNonBlocking(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/ReceiveMessageFrom.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/ReceiveMessageFrom.cs index d6161b3e9d0958..6ff9b4aac7d30e 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/ReceiveMessageFrom.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/ReceiveMessageFrom.cs @@ -287,19 +287,19 @@ public async Task ReceiveTruncated_TruncatedFlagIsSetOnReceive() } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ReceiveMessageFrom_Sync : ReceiveMessageFrom { public ReceiveMessageFrom_Sync(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ReceiveMessageFrom_SyncForceNonBlocking : ReceiveMessageFrom { public ReceiveMessageFrom_SyncForceNonBlocking(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ReceiveMessageFrom_Apm : ReceiveMessageFrom { public ReceiveMessageFrom_Apm(ITestOutputHelper output) : base(output) { } @@ -350,7 +350,7 @@ public void EndReceiveMessageFrom_AddressFamilyDoesNotMatch_Throws_ArgumentExcep Assert.Throws("endPoint", () => socket.EndReceiveMessageFrom(iar, ref socketFlags, ref invalidEndPoint, out _)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void BeginReceiveMessageFrom_RemoteEpIsReturnedWhenCompletedSynchronously() { EndPoint anyEp = new IPEndPoint(IPAddress.Any, 0); @@ -417,7 +417,7 @@ public void ReceiveFromAsync_NullAsyncEventArgs_Throws_ArgumentNullException() Assert.Throws(() => socket.ReceiveMessageFromAsync(null)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false, 0)] [InlineData(false, 1)] [InlineData(false, 2)] @@ -498,13 +498,13 @@ public void ReceiveSentMessages_ReuseEventArgs_Success(bool ipv4, int bufferMode } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ReceiveMessageFrom_SpanSync : ReceiveMessageFrom { public ReceiveMessageFrom_SpanSync(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class ReceiveMessageFrom_SpanSyncForceNonBlocking : ReceiveMessageFrom { public ReceiveMessageFrom_SpanSyncForceNonBlocking(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SelectAndPollTests.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SelectAndPollTests.cs index a0bc4ed573441b..0f052b80f6ed51 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SelectAndPollTests.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SelectAndPollTests.cs @@ -9,7 +9,7 @@ namespace System.Net.Sockets.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public class SelectAndPollTests { private const int SelectTimeout = 100; diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs index 0e7d6649bdf814..7e5618eb238925 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs @@ -11,7 +11,7 @@ namespace System.Net.Sockets.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public class SelectTest { private readonly ITestOutputHelper _log; @@ -354,7 +354,7 @@ private static void DisposeSockets(IEnumerable> soc } [Collection(nameof(DisableParallelization))] - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public class SelectTest_NonParallel { [OuterLoop] @@ -422,7 +422,7 @@ private static void DoAccept(Socket listenSocket, int connectionsToAccept) } [Collection(nameof(DisableParallelization))] - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // Set of tests to not run together with any other tests. public class NoParallelSelectTests { diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs index 7788a14530347b..fc2c8850e66242 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs @@ -375,25 +375,25 @@ private TempFile CreateFileToSend(int size, bool sendPreAndPostBuffers, out byte } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendFile_SyncSpan : SendFile { public SendFile_SyncSpan(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendFile_SyncSpanForceNonBlocking : SendFile { public SendFile_SyncSpanForceNonBlocking(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendFile_ArraySync : SendFile { public SendFile_ArraySync(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendFile_SyncForceNonBlocking : SendFile { public SendFile_SyncForceNonBlocking(ITestOutputHelper output) : base(output) { } @@ -465,7 +465,7 @@ public async Task SendFileAsync_CanceledDuringOperation_Throws(bool ipv6) } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendFile_Apm : SendFile { public SendFile_Apm(ITestOutputHelper output) : base(output) { } @@ -535,19 +535,19 @@ public async Task GreaterThan2GBFile_SendsAllBytes() } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendFile_NonParallel_SyncSpan : SendFile_NonParallel { public SendFile_NonParallel_SyncSpan(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendFile_NonParallel_SyncSpanForceNonBlocking : SendFile_NonParallel { public SendFile_NonParallel_SyncSpanForceNonBlocking(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendFile_NonParallel_ArraySync : SendFile_NonParallel { public SendFile_NonParallel_ArraySync(ITestOutputHelper output) : base(output) { } @@ -559,7 +559,7 @@ public sealed class SendFile_NonParallel_Task : SendFile_NonParallel { public SendFile_NonParallel_Apm(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs index 4aefa65406d7c0..ad6634b71fa2d3 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendPacketsAsync.cs @@ -14,7 +14,7 @@ namespace System.Net.Sockets.Tests { [Collection(nameof(DisableParallelization))] - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public class SendPacketsAsync : IDisposable { private readonly ITestOutputHelper _log; diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceive.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceive.cs index 7ce9264bf224e1..b40047ff515d58 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceive.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceive.cs @@ -1191,7 +1191,7 @@ await RetryHelper.ExecuteAsync(async () => } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendReceive_Sync : SendReceive { public SendReceive_Sync(ITestOutputHelper output) : base(output) { } @@ -1248,13 +1248,13 @@ select Task.Factory.StartNew(() => pair.Item1.Receive(new byte[1]), Cancellation } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendReceive_SyncForceNonBlocking : SendReceive { public SendReceive_SyncForceNonBlocking(ITestOutputHelper output) : base(output) {} } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendReceive_Apm : SendReceive { public SendReceive_Apm(ITestOutputHelper output) : base(output) {} @@ -1270,7 +1270,7 @@ public sealed class SendReceive_Eap : SendReceive public SendReceive_Eap(ITestOutputHelper output) : base(output) {} } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendReceive_SpanSync : SendReceive { public SendReceive_SpanSync(ITestOutputHelper output) : base(output) { } @@ -1344,7 +1344,7 @@ public async Task Send_0ByteSendTo_Span_Success() } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendReceive_SpanSyncForceNonBlocking : SendReceive { public SendReceive_SpanSyncForceNonBlocking(ITestOutputHelper output) : base(output) { } @@ -1563,7 +1563,7 @@ public async Task DisposedSocket_ThrowsOperationCanceledException() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task BlockingAsyncContinuations_OperationsStillCompleteSuccessfully() { if (UsesSync) return; diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveMisc.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveMisc.cs index 271c5d68896bec..0d64a74231bd11 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveMisc.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveMisc.cs @@ -10,7 +10,7 @@ namespace System.Net.Sockets.Tests { public class SendReceiveMisc { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void SendRecvIovMaxTcp_Success() { // sending/receiving more than IOV_MAX segments causes EMSGSIZE on some platforms. @@ -76,7 +76,7 @@ public void SendRecvIovMaxTcp_Success() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void SendIovMaxUdp_SuccessOrMessageSize() { // sending more than IOV_MAX segments causes EMSGSIZE on some platforms. @@ -117,7 +117,7 @@ public void SendIovMaxUdp_SuccessOrMessageSize() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ReceiveIovMaxUdp_SuccessOrMessageSize() { // receiving more than IOV_MAX segments causes EMSGSIZE on some platforms. @@ -190,7 +190,7 @@ public async Task ReceiveIovMaxUdp_SuccessOrMessageSize() await receiveTask; } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [SkipOnPlatform(TestPlatforms.Windows, "All data is sent, even when very large (100M).")] public void SocketSendWouldBlock_ReturnsBytesSent() { @@ -219,7 +219,7 @@ public void SocketSendWouldBlock_ReturnsBytesSent() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [PlatformSpecific(TestPlatforms.AnyUnix)] public async Task Socket_ReceiveFlags_Success() { @@ -284,7 +284,7 @@ public async Task Socket_ReceiveFlags_Success() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(true)] [InlineData(false)] public void ReceiveFrom_MultipleRounds_Success(bool async) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveNonParallel.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveNonParallel.cs index 20f1983f52e67f..c24adba798e68b 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveNonParallel.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveNonParallel.cs @@ -104,19 +104,19 @@ public async Task SendToRecvFrom_Datagram_UDP(IPAddress loopbackAddress, bool us } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendReceiveNonParallel_Sync : SendReceiveNonParallel { public SendReceiveNonParallel_Sync(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendReceiveNonParallel_SyncForceNonBlocking : SendReceiveNonParallel { public SendReceiveNonParallel_SyncForceNonBlocking(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendReceiveNonParallel_Apm : SendReceiveNonParallel { public SendReceiveNonParallel_Apm(ITestOutputHelper output) : base(output) { } @@ -137,13 +137,13 @@ public sealed class SendReceiveNonParallel_Eap : SendReceiveNonParallel { public SendReceiveNonParallel_SpanSync(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendReceiveNonParallel_SpanSyncForceNonBlocking : SendReceiveNonParallel { public SendReceiveNonParallel_SpanSyncForceNonBlocking(ITestOutputHelper output) : base(output) { } diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveUdpClient.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveUdpClient.cs index 851ba978ebca65..543e659ebe39a0 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveUdpClient.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive/SendReceiveUdpClient.cs @@ -10,7 +10,7 @@ namespace System.Net.Sockets.Tests public sealed class SendReceiveUdpClient : MemberDatas { [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(LoopbacksAndUseMemory))] public async Task SendToRecvFromAsync_Datagram_UDP_UdpClient(IPAddress loopbackAddress, bool useMemoryOverload) { diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendTo.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendTo.cs index 2208d905efb675..aba3e5dbe3e507 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendTo.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendTo.cs @@ -123,31 +123,31 @@ public async Task Disposed_Throws() } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendTo_SyncSpan : SendTo { public SendTo_SyncSpan(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendTo_SyncSpanForceNonBlocking : SendTo { public SendTo_SyncSpanForceNonBlocking(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendTo_ArraySync : SendTo { public SendTo_ArraySync(ITestOutputHelper output) : base(output) { } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendTo_SyncForceNonBlocking : SendTo { public SendTo_SyncForceNonBlocking(ITestOutputHelper output) : base(output) {} } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class SendTo_Apm : SendTo { public SendTo_Apm(ITestOutputHelper output) : base(output) {} diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Shutdown.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Shutdown.cs index 00022fd6126782..c5bccac0a86dce 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Shutdown.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Shutdown.cs @@ -71,7 +71,7 @@ private static void OnOperationCompleted(object sender, SocketAsyncEventArgs arg } [OuterLoop] // Explicitly waits for 5 seconds - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Shutdown_TCP_CLOSED_Success() { // NOTE: this value should technically be at least as long as the amount diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketAsyncEventArgsTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketAsyncEventArgsTest.cs index 7e96416c18dd0d..20f12327d69867 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketAsyncEventArgsTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketAsyncEventArgsTest.cs @@ -71,7 +71,7 @@ public void Dispose_MultipleCalls_Success() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Dispose_WhileInUse_DisposeDelayed() { using (var listen = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) @@ -105,7 +105,7 @@ await Task.WhenAll( } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task ExecutionContext_FlowsIfNotSuppressed(bool suppressed) @@ -147,13 +147,13 @@ await Task.WhenAll( } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ExecutionContext_SocketAsyncEventArgs_Ctor_Default_FlowIsNotSuppressed() { await ExecutionContext_SocketAsyncEventArgs_Ctors(() => new SocketAsyncEventArgs(), false); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(true)] [InlineData(false)] public async Task ExecutionContext_SocketAsyncEventArgs_Ctor_UnsafeSuppressExecutionContextFlow(bool suppressed) @@ -522,7 +522,7 @@ public async Task ConnectAsync_WithData_OK(bool useFastOpen, int size) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false, 1)] [InlineData(false, 10_000)] [InlineData(true, 1)] // This should fit with SYN flag @@ -688,7 +688,7 @@ private static void OnAcceptCompleted(object sender, SocketAsyncEventArgs args) } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [PlatformSpecific(TestPlatforms.Windows)] // Unix platforms don't yet support receiving data with AcceptAsync. public void AcceptAsync_WithReceiveBuffer_Success() { @@ -1043,7 +1043,7 @@ void CreateSocketAsyncEventArgs() // separated out so that JIT doesn't extend li }, 30_000)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task SendTo_DifferentEP_Success(bool ipv4) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketDuplicationTests.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketDuplicationTests.cs index 58db131e2476d3..4a46fbcee5b555 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketDuplicationTests.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketDuplicationTests.cs @@ -387,12 +387,12 @@ static async Task HandlerServerCode(string ipcPortString) } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public class Synchronous : PolymorphicTests { } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public class Apm : PolymorphicTests { } diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs index 85921abc15bef4..8b1b289c9d8a13 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketOptionNameTest.cs @@ -12,7 +12,7 @@ namespace System.Net.Sockets.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public partial class SocketOptionNameTest { private static bool SocketsReuseUnicastPortSupport => Capability.SocketsReuseUnicastPortSupport().HasValue; @@ -730,7 +730,7 @@ public void SetUnsupportedRawSocketOption_DoesNotDisconnectSocket() [Collection(nameof(DisableParallelization))] // Set of tests to not run together with any other tests. - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public class NoParallelTests { [Fact] diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/TcpClientTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/TcpClientTest.cs index 609e215fea88d7..5abadeba53075d 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/TcpClientTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/TcpClientTest.cs @@ -38,7 +38,7 @@ public void Ctor_InvalidArguments_Throws() AssertExtensions.Throws("port", () => new TcpClient("localhost", -1)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Connect_InvalidArguments_Throws() { using (var client = new TcpClient()) @@ -77,7 +77,7 @@ public void GetStream_NotConnected_Throws() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Active_Roundtrips() { using (var client = new DerivedTcpClient()) @@ -93,7 +93,7 @@ public void Active_Roundtrips() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void DisposeClose_OperationsThrow(bool close) @@ -213,7 +213,7 @@ public async Task ConnectAsync_DnsEndPoint_Success(int mode) } [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(2)] @@ -469,7 +469,7 @@ public async Task Dispose_CancelsConnectAsync(bool connectByName) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Connect_Dual_Success() { if (!Socket.OSSupportsIPv6) @@ -496,7 +496,7 @@ public void Connect_Dual_Success() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false, "::ffff:127.0.0.1")] [InlineData(false, "127.0.0.1")] [InlineData(false, "localhost")] diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/TcpListenerTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/TcpListenerTest.cs index a328b292754157..6d90fff9cfe3e4 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/TcpListenerTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/TcpListenerTest.cs @@ -101,7 +101,7 @@ public void Start_InvalidArgs_Throws() listener.Stop(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Pending_TrueWhenWaitingRequest() { var listener = new TcpListener(IPAddress.Loopback, 0); @@ -120,7 +120,7 @@ public async Task Pending_TrueWhenWaitingRequest() Assert.Throws(() => listener.Pending()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Accept_Invalid_Throws() { var listener = new TcpListener(IPAddress.Loopback, 0); @@ -281,7 +281,7 @@ public void ExclusiveAddressUse_SetStartAndStopListenerThenRead_ReadSuccessfully Assert.True(listener.ExclusiveAddressUse); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void EndAcceptSocket_WhenStopped_ThrowsObjectDisposedException() { var listener = new TcpListener(IPAddress.Loopback, 0); @@ -296,7 +296,7 @@ public void EndAcceptSocket_WhenStopped_ThrowsObjectDisposedException() Assert.Throws(() => listener.EndAcceptSocket(iar)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void EndAcceptTcpClient_WhenStopped_ThrowsObjectDisposedException() { var listener = new TcpListener(IPAddress.Loopback, 0); diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UdpClientTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UdpClientTest.cs index cd5a209dfa5b4b..1637b985083876 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/UdpClientTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/UdpClientTest.cs @@ -60,7 +60,7 @@ public void Ctor_NullEndpoint_Throws() AssertExtensions.Throws("localEP", () => new UdpClient(null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Ctor_CanSend() { using (var udpClient = new DerivedUdpClient()) @@ -80,7 +80,7 @@ public async Task Ctor_CanSendAsync() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Ctor_Int_CanSend() { try @@ -97,7 +97,7 @@ public void Ctor_Int_CanSend() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Ctor_IntAddressFamily_IPv4_CanSend() { try @@ -114,7 +114,7 @@ public void Ctor_IntAddressFamily_IPv4_CanSend() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Ctor_IntAddressFamily_IPv6_CanSend() { try @@ -131,7 +131,7 @@ public void Ctor_IntAddressFamily_IPv6_CanSend() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Ctor_IPEndPoint_CanSend() { try @@ -148,7 +148,7 @@ public void Ctor_IPEndPoint_CanSend() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Ctor_StringInt_CanSend() { using (var udpClient = new DerivedUdpClient("localhost", UnusedPort)) @@ -158,7 +158,7 @@ public void Ctor_StringInt_CanSend() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void DisposeClose_OperationsThrow(bool close) @@ -334,7 +334,7 @@ public void ExclusiveAddressUse_Roundtrips() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void InvalidArguments_Throw() { using (var udpClient = new UdpClient("localhost", UnusedPort)) @@ -345,7 +345,7 @@ public void InvalidArguments_Throw() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void BeginSend_NegativeBytes_Throws() { using (UdpClient udpClient = new UdpClient(AddressFamily.InterNetwork)) @@ -360,7 +360,7 @@ public void BeginSend_NegativeBytes_Throws() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void BeginSend_BytesMoreThanArrayLength_Throws() { using (UdpClient udpClient = new UdpClient(AddressFamily.InterNetwork)) @@ -375,7 +375,7 @@ public void BeginSend_BytesMoreThanArrayLength_Throws() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void BeginSend_AsyncOperationCompletes_Success() { using (UdpClient udpClient = new UdpClient()) @@ -389,7 +389,7 @@ public void BeginSend_AsyncOperationCompletes_Success() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Send_InvalidArguments_Throws() { using (var udpClient = new DerivedUdpClient()) @@ -434,7 +434,7 @@ public void Client_Idempotent() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Connect_InvalidArguments_Throws() { using (var udpClient = new UdpClient()) @@ -469,7 +469,7 @@ public async Task ConnectAsync_IPAddressHost_Success() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Connect_StringHost_Success() { using (var c = new UdpClient()) @@ -478,7 +478,7 @@ public void Connect_StringHost_Success() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Connect_IPAddressHost_Success() { using (var c = new UdpClient()) @@ -519,7 +519,7 @@ public void AllowNatTraversal_AnyUnix(bool allow) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void Send_Receive_Success(bool ipv4) @@ -583,7 +583,7 @@ private static void AssertReceive(UdpClient receiver, byte[] sentData) Assert.True(Enumerable.SequenceEqual(sentData, data)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void Send_Available_Success(bool ipv4) @@ -599,7 +599,7 @@ public void Send_Available_Success(bool ipv4) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void BeginEndSend_BeginEndReceive_Success(bool ipv4) diff --git a/src/libraries/System.Net.WebSockets.Client/tests/SendReceiveTest.cs b/src/libraries/System.Net.WebSockets.Client/tests/SendReceiveTest.cs index f74e1efc848f48..8c04875a9b12a6 100644 --- a/src/libraries/System.Net.WebSockets.Client/tests/SendReceiveTest.cs +++ b/src/libraries/System.Net.WebSockets.Client/tests/SendReceiveTest.cs @@ -446,7 +446,7 @@ protected async Task RunClient_ZeroByteReceive_CompletesWhenDataAvailable(Uri se var receiveBuffer = new byte[1]; t = ReceiveAsync(cws, new ArraySegment(receiveBuffer), ctsDefault.Token); // this is not synchronously possible when the WS client is on another WebWorker - if (!PlatformDetection.IsWasmThreadingSupported) + if (!PlatformDetection.IsMultithreadingSupported) { Assert.Equal(TaskStatus.RanToCompletion, t.Status); } diff --git a/src/libraries/System.Net.WebSockets/tests/WebSocketDeflateTests.cs b/src/libraries/System.Net.WebSockets/tests/WebSocketDeflateTests.cs index 5d13e583323003..7990c4724f0f00 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)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendHelloWithContextTakeover() { WebSocketTestStream stream = new(); @@ -164,7 +164,7 @@ public async Task ReceiveHelloWithoutContextTakeover() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task SendHelloWithoutContextTakeover() { WebSocketTestStream stream = new(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Environment.cs b/src/libraries/System.Private.CoreLib/src/System/Environment.cs index 08b49c3dedf763..c351ff2d7f8668 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Environment.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Environment.cs @@ -38,13 +38,9 @@ public readonly struct ProcessCpuUsage /// /// Gets whether the current machine has only a single processor. /// -#if FEATURE_SINGLE_THREADED - internal const bool IsSingleProcessor = true; - public static int ProcessorCount => 1; -#else - internal static bool IsSingleProcessor => ProcessorCount == 1; - public static int ProcessorCount { get; } = GetProcessorCount(); -#endif + internal static bool IsSingleProcessor => RuntimeFeature.IsMultithreadingSupported ? ProcessorCount == 1 : true; + public static int ProcessorCount { get; } = RuntimeFeature.IsMultithreadingSupported ? GetProcessorCount() : 1; + private static volatile sbyte s_privilegedProcess; /// diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/Stream.cs b/src/libraries/System.Private.CoreLib/src/System/IO/Stream.cs index 66184e0dfdcc1d..e3344bf7a743b4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/Stream.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/Stream.cs @@ -218,14 +218,16 @@ internal Task BeginReadInternal( Task? semaphoreTask = null; // The synchronous path is emulating legacy behavior. - // Drop the emulation for IsSingleThreaded to avoid throwing. - if (Thread.IsSingleThreaded || serializeAsynchronously) + // Drop the emulation for !IsMultithreadingSupported to avoid throwing. + if (!RuntimeFeature.IsMultithreadingSupported || serializeAsynchronously) { semaphoreTask = semaphore.WaitAsync(); } else { +#pragma warning disable CA1416 // guarded by IsMultithreadingSupported semaphore.Wait(); +#pragma warning restore CA1416 // guarded by IsMultithreadingSupported } // Create the task to asynchronously do a Read. This task serves both @@ -493,14 +495,16 @@ internal Task BeginWriteInternal( Task? semaphoreTask = null; // The synchronous path is emulating legacy behavior. - // Drop the emulation for IsSingleThreaded to avoid throwing. - if (Thread.IsSingleThreaded || serializeAsynchronously) + // Drop the emulation for !IsMultithreadingSupported to avoid throwing. + if (!RuntimeFeature.IsMultithreadingSupported || serializeAsynchronously) { semaphoreTask = semaphore.WaitAsync(); // kick off the asynchronous wait, but don't block } else { - semaphore.Wait(); // synchronously wait here +#pragma warning disable CA1416 // guarded by IsMultithreadingSupported + semaphore.Wait(); +#pragma warning restore CA1416 // guarded by IsMultithreadingSupported } // Create the task to asynchronously do a Write. This task serves both diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs b/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs index 8f879a79a6701d..76d57c065454c9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/TextWriter.cs @@ -883,7 +883,7 @@ public static TextWriter Synchronized(TextWriter writer) { ArgumentNullException.ThrowIfNull(writer); - return Thread.IsSingleThreaded || writer is SyncTextWriter + return !RuntimeFeature.IsMultithreadingSupported || writer is SyncTextWriter ? writer : new SyncTextWriter(writer); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs index eb6afdf66d1512..fd7c20058a6d14 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeFeature.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.Versioning; +using System.Diagnostics.CodeAnalysis; namespace System.Runtime.CompilerServices { @@ -65,8 +66,31 @@ VirtualStaticsInInterfaces or nameof(IsDynamicCodeSupported) => IsDynamicCodeSupported, nameof(IsDynamicCodeCompiled) => IsDynamicCodeCompiled, + nameof(IsMultithreadingSupported) => IsMultithreadingSupported, _ => false, }; } + + [FeatureSwitchDefinition("System.Runtime.CompilerServices.RuntimeFeature.IsMultithreadingSupported")] +#if FEATURE_SINGLE_THREADED + public static bool IsMultithreadingSupported => false; + [DoesNotReturn] + internal static void ThrowIfMultithreadingIsNotSupported() + { + throw new PlatformNotSupportedException(); + } +#else + public static bool IsMultithreadingSupported => true; +#if FEATURE_WASM_MANAGED_THREADS + internal static void ThrowIfMultithreadingIsNotSupported() + { + System.Threading.Thread.AssureBlockingPossible(); + } +#else + internal static void ThrowIfMultithreadingIsNotSupported() { } +#endif +#endif + + } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs index 2ac672238f74d9..60999d36a68aca 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs @@ -362,7 +362,7 @@ internal static void ResetThreadPoolThread(Thread currentThread) [Conditional("DEBUG")] internal static void CheckThreadPoolAndContextsAreDefault() { - Debug.Assert(Thread.IsSingleThreaded || Thread.CurrentThread.IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads + Debug.Assert(!RuntimeFeature.IsMultithreadingSupported || Thread.CurrentThread.IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads Debug.Assert(Thread.CurrentThread._executionContext == null, "ThreadPool thread not on Default ExecutionContext."); Debug.Assert(Thread.CurrentThread._synchronizationContext == null, "ThreadPool thread not on Default SynchronizationContext."); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs index db99731ec0d950..543b18c5048316 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs @@ -519,7 +519,7 @@ internal int TryEnterSlow(int timeoutMs, int currentThreadId) goto Locked; } - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); // Lock was not acquired and a waiter was registered. All following paths need to unregister the waiter, including // exceptional paths. diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.cs index 878e1ae6fd3a39..a4b6baf2c2a2a0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Internal; @@ -105,7 +106,7 @@ public bool Wait(int timeoutMs, short activeThreadCount) } } - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); return WaitSlow(timeoutMs, activeThreadCount); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelLock.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelLock.cs index 93fa0d54f44aee..8b34b3e8850989 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelLock.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelLock.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.CompilerServices; namespace System.Threading { @@ -153,7 +154,7 @@ private void WaitAndAcquire() { VerifyIsNotLocked(); - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); // Spin a bit to see if the lock becomes available, before forcing the thread into a wait state if (_spinWaiter.SpinWaitForCondition(s_spinWaitTryAcquireCallback, this, SpinCount, SpinSleep0Threshold)) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs index 5d3327f343ca6a..c07fb07a8328d3 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ManualResetEventSlim.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; using System.Runtime.Versioning; namespace System.Threading @@ -488,7 +489,7 @@ public bool Wait(int millisecondsTimeout, CancellationToken cancellationToken) ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeout, -1); - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); if (!IsSet) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Monitor.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Monitor.cs index 4aa19dda87e8a6..0eaf0a79c14e9c 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Monitor.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Monitor.cs @@ -97,7 +97,7 @@ private static Condition GetCondition(object obj) [UnsupportedOSPlatform("browser")] public static bool Wait(object obj, int millisecondsTimeout) { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); return GetCondition(obj).Wait(millisecondsTimeout, obj); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.Portable.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.Portable.cs index 1e57f434d6f834..8008b287eddddc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.Portable.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/RegisteredWaitHandle.Portable.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.CompilerServices; using System.Runtime.Versioning; using Microsoft.Win32.SafeHandles; @@ -55,7 +56,7 @@ public sealed partial class RegisteredWaitHandle : MarshalByRefObject internal RegisteredWaitHandle(WaitHandle waitHandle, _ThreadPoolWaitOrTimerCallback callbackHelper, int millisecondsTimeout, bool repeating) { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); #if TARGET_WINDOWS Debug.Assert(!ThreadPool.UseWindowsThreadPool); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/SemaphoreSlim.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/SemaphoreSlim.cs index a55ff012d9eecc..a530c22b051d20 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/SemaphoreSlim.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/SemaphoreSlim.cs @@ -320,7 +320,7 @@ private bool WaitCore(long millisecondsTimeout, CancellationToken cancellationTo return false; } - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); long startTime = 0; if (millisecondsTimeout != Timeout.Infinite && millisecondsTimeout > 0) @@ -451,7 +451,7 @@ private bool WaitCore(long millisecondsTimeout, CancellationToken cancellationTo [UnsupportedOSPlatform("browser")] private bool WaitUntilCountOrTimeout(long millisecondsTimeout, long startTime, CancellationToken cancellationToken) { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); int monitorWaitMilliseconds = Timeout.Infinite; diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/SpinWait.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/SpinWait.cs index 1862346abdb481..0a597138eb17d6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/SpinWait.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/SpinWait.cs @@ -8,6 +8,7 @@ // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Diagnostics; +using System.Runtime.CompilerServices; namespace System.Threading { @@ -85,11 +86,9 @@ public struct SpinWait /// depends on the likelihood of the spin being successful and how long the wait would be but those are not accounted /// for here. /// -#if FEATURE_SINGLE_THREADED - internal const int SpinCountForSpinBeforeWait = 1; -#else - internal static readonly int SpinCountForSpinBeforeWait = Environment.IsSingleProcessor ? 1 : 35; -#endif + internal static readonly int SpinCountForSpinBeforeWait = RuntimeFeature.IsMultithreadingSupported + ? Environment.IsSingleProcessor ? 1 : 35 + : 1; // The number of times we've spun already. private int _count; diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs index 233b32e824e14c..008df2bf3cd5a9 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs @@ -3004,7 +3004,7 @@ private bool InternalWaitCore(int millisecondsTimeout, CancellationToken cancell } else { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); returnValue = SpinThenBlockingWait(millisecondsTimeout, cancellationToken); } @@ -3061,7 +3061,7 @@ private bool SpinThenBlockingWait(int millisecondsTimeout, CancellationToken can bool returnValue = SpinWait(millisecondsTimeout); if (!returnValue) { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); // We're about to block waiting for the task to complete, which is expensive, and if // the task being waited on depends on some other work to run, this thread could end up @@ -3141,7 +3141,7 @@ private bool SpinWait(int millisecondsTimeout) { if (IsCompleted) return true; - if (Thread.IsSingleThreaded) + if (!RuntimeFeature.IsMultithreadingSupported) { return false; } @@ -4998,7 +4998,7 @@ private static bool WaitAllCore(ReadOnlySpan tasks, int millisecondsTimeou if (waitedOnTaskList != null) { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); // Block waiting for the tasks to complete. returnValue = WaitAllBlockingCore(waitedOnTaskList, millisecondsTimeout, cancellationToken); @@ -5073,7 +5073,7 @@ private static bool WaitAllBlockingCore(List tasks, int millisecondsTimeou Debug.Assert(tasks != null, "Expected a non-null list of tasks"); Debug.Assert(tasks.Count > 0, "Expected at least one task"); - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); bool waitCompleted = false; var mres = new SetOnCountdownMres(tasks.Count); @@ -5340,7 +5340,7 @@ private static int WaitAnyCore(Task[] tasks, int millisecondsTimeout, Cancellati if (signaledTaskIndex == -1 && tasks.Length != 0) { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); Task firstCompleted = TaskFactory.CommonCWAnyLogic(tasks, isSyncBlocking: true); bool waitCompleted = firstCompleted.Wait(millisecondsTimeout, cancellationToken); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs index 1c7ee620860a72..1eb31737815e22 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs @@ -26,7 +26,7 @@ public static partial class TaskAsyncEnumerableExtensions [UnsupportedOSPlatform("browser")] public static IEnumerable ToBlockingEnumerable(this IAsyncEnumerable source, CancellationToken cancellationToken = default) { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); IAsyncEnumerator enumerator = source.GetAsyncEnumerator(cancellationToken); // A ManualResetEventSlim variant that lets us reuse the same @@ -81,7 +81,7 @@ public ManualResetEventWithAwaiterSupport() [UnsupportedOSPlatform("browser")] public void Wait(TAwaiter awaiter) where TAwaiter : ICriticalNotifyCompletion { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); awaiter.UnsafeOnCompleted(_onCompleted); Wait(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskFactory_T.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskFactory_T.cs index 487af7c324cf5b..dfbb96c59e3067 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskFactory_T.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskFactory_T.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.CompilerServices; namespace System.Threading.Tasks { @@ -676,7 +677,7 @@ internal static Task FromAsyncImpl( } else { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); #pragma warning disable CA1416 // Validate platform compatibility, issue: https://github.com/dotnet/runtime/issues/44544 ThreadPool.RegisterWaitForSingleObject( diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs index d4edf231413265..00f62df966a945 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs @@ -12,6 +12,7 @@ using System.Collections.Generic; using System.Diagnostics; +using System.Runtime.CompilerServices; namespace System.Threading.Tasks { @@ -42,14 +43,16 @@ internal ThreadPoolTaskScheduler() protected internal override void QueueTask(Task task) { TaskCreationOptions options = task.Options; - if (!Thread.IsSingleThreaded && (options & TaskCreationOptions.LongRunning) != 0) + if (RuntimeFeature.IsMultithreadingSupported && (options & TaskCreationOptions.LongRunning) != 0) { +#pragma warning disable CA1416 // guarded by IsMultithreadingSupported // Run LongRunning tasks on their own dedicated thread. new Thread(s_longRunningThreadWork) { IsBackground = true, Name = ".NET Long Running Task" }.UnsafeStart(task); +#pragma warning restore CA1416 // guarded by IsMultithreadingSupported } else { diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs index 161889ce1bd082..da04bf1a2a79c5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs @@ -195,7 +195,7 @@ public Thread(ParameterizedThreadStart start, int maxStackSize) private void Start(object? parameter, bool captureContext) { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); StartHelper? startHelper = _startHelper; @@ -238,7 +238,7 @@ private void Start(object? parameter, bool captureContext) private void Start(bool captureContext) { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); StartHelper? startHelper = _startHelper; // In the case of a null startHelper (second call to start on same thread) @@ -429,7 +429,7 @@ internal void SetThreadPoolWorkerThreadName() internal void ResetThreadPoolThread() { Debug.Assert(this == CurrentThread); - Debug.Assert(IsSingleThreaded || IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads + Debug.Assert(!RuntimeFeature.IsMultithreadingSupported || IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads if (_mayNeedResetForThreadPool) { @@ -441,7 +441,7 @@ internal void ResetThreadPoolThread() private void ResetThreadPoolThreadSlow() { Debug.Assert(this == CurrentThread); - Debug.Assert(IsSingleThreaded || IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads + Debug.Assert(!RuntimeFeature.IsMultithreadingSupported || IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads Debug.Assert(_mayNeedResetForThreadPool); _mayNeedResetForThreadPool = false; @@ -737,27 +737,6 @@ public static int GetCurrentProcessorId() return ProcessorIdCache.GetCurrentProcessorId(); } - [SupportedOSPlatformGuard("browser")] - [SupportedOSPlatformGuard("wasi")] -#if FEATURE_SINGLE_THREADED - internal static bool IsSingleThreaded => true; - [DoesNotReturn] - internal static void ThrowIfSingleThreaded() - { - throw new PlatformNotSupportedException(); - } -#else - internal static bool IsSingleThreaded => false; -#if FEATURE_WASM_MANAGED_THREADS - internal static void ThrowIfSingleThreaded() - { - AssureBlockingPossible(); - } -#else - internal static void ThrowIfSingleThreaded() { } -#endif -#endif - #if FEATURE_WASM_MANAGED_THREADS [ThreadStatic] public static bool ThrowOnBlockingWaitOnJSInteropThread; diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Unix.cs index f0cd642cbeab3b..c133660deaab88 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPool.Unix.cs @@ -89,7 +89,7 @@ internal static RegisteredWaitHandle RegisterWaitForSingleObject( bool executeOnlyOnce, bool flowExecutionContext) { - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); return PortableThreadPool.RegisterWaitForSingleObject(waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce, flowExecutionContext); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs index 86cba10e28d6a3..ba92e692eeac54 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/ThreadPoolWorkQueue.cs @@ -1445,7 +1445,7 @@ public static RegisteredWaitHandle RegisterWaitForSingleObject( if (millisecondsTimeOutInterval > (uint)int.MaxValue && millisecondsTimeOutInterval != uint.MaxValue) throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_LessEqualToIntegerMaxVal); - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); return RegisterWaitForSingleObject(waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce, true); } @@ -1465,7 +1465,7 @@ public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( if (millisecondsTimeOutInterval > (uint)int.MaxValue && millisecondsTimeOutInterval != uint.MaxValue) throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); return RegisterWaitForSingleObject(waitObject, callBack, state, millisecondsTimeOutInterval, executeOnlyOnce, false); } @@ -1498,7 +1498,7 @@ public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( { ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeOutInterval, -1); - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); return RegisterWaitForSingleObject(waitObject, callBack, state, (uint)millisecondsTimeOutInterval, executeOnlyOnce, false); } @@ -1517,7 +1517,7 @@ public static RegisteredWaitHandle RegisterWaitForSingleObject( ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeOutInterval, -1); ArgumentOutOfRangeException.ThrowIfGreaterThan(millisecondsTimeOutInterval, int.MaxValue); - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); return RegisterWaitForSingleObject(waitObject, callBack, state, (uint)millisecondsTimeOutInterval, executeOnlyOnce, true); } @@ -1536,7 +1536,7 @@ public static RegisteredWaitHandle UnsafeRegisterWaitForSingleObject( ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeOutInterval, -1); ArgumentOutOfRangeException.ThrowIfGreaterThan(millisecondsTimeOutInterval, int.MaxValue); - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); return RegisterWaitForSingleObject(waitObject, callBack, state, (uint)millisecondsTimeOutInterval, executeOnlyOnce, false); } @@ -1557,7 +1557,7 @@ bool executeOnlyOnce ArgumentOutOfRangeException.ThrowIfLessThan(tm, -1, nameof(timeout)); ArgumentOutOfRangeException.ThrowIfGreaterThan(tm, int.MaxValue, nameof(timeout)); - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); return RegisterWaitForSingleObject(waitObject, callBack, state, (uint)tm, executeOnlyOnce, true); } @@ -1578,7 +1578,7 @@ bool executeOnlyOnce ArgumentOutOfRangeException.ThrowIfLessThan(tm, -1, nameof(timeout)); ArgumentOutOfRangeException.ThrowIfGreaterThan(tm, int.MaxValue, nameof(timeout)); - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); return RegisterWaitForSingleObject(waitObject, callBack, state, (uint)tm, executeOnlyOnce, false); } diff --git a/src/libraries/System.Private.Uri/tests/FunctionalTests/UriTests.cs b/src/libraries/System.Private.Uri/tests/FunctionalTests/UriTests.cs index 577ff26c093b06..b7f76393c0e4a0 100644 --- a/src/libraries/System.Private.Uri/tests/FunctionalTests/UriTests.cs +++ b/src/libraries/System.Private.Uri/tests/FunctionalTests/UriTests.cs @@ -771,7 +771,7 @@ public static void Uri_CachesDnsSafeHost() Assert.Same(uri.DnsSafeHost, uri.DnsSafeHost); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Uri_DoesNotLockOnString() { // Don't intern the string we lock on 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..793d9cc372207e 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/53987", TestRuntimes.Mono)] public static void SynchronizationContextCurrent_NotUsedForAsyncOperations() { diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs index 5699868c280638..29f58152ba8687 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs @@ -77,7 +77,7 @@ public int Transform(object args) } //[Variation("Multiple Transform(): Reader - Basic Test")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc1() { Load("xslt_multithreading_test.xsl", "foo.xml"); @@ -97,7 +97,7 @@ public void proc1() } //[Variation("Multiple Transform(): Reader - QFE 505 Repro")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc2() { using (new AllowDefaultResolverContext()) @@ -118,7 +118,7 @@ public void proc2() } //[Variation("Multiple Transform(): Reader - AVTs")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc3() { Load("xslt_multith_AVTs.xsl", "xslt_multith_AVTs.xml"); @@ -138,7 +138,7 @@ public void proc3() } //[Variation("Multiple Transform(): Reader - xsl:key")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc4() { Load("xslt_multith_keytest.xsl", "xslt_multith_keytest.xml"); @@ -158,7 +158,7 @@ public void proc4() } //[Variation("Multiple Transform(): Reader - xsl:sort")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc5() { Load("xslt_multith_sorting.xsl", "xslt_multith_sorting.xml"); @@ -178,7 +178,7 @@ public void proc5() } //[Variation("Multiple Transform(): Reader - Attribute Sets")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc6() { Load("xslt_mutith_attribute_sets.xsl", "xslt_mutith_attribute_sets.xml"); @@ -198,7 +198,7 @@ public void proc6() } //[Variation("Multiple Transform(): Reader - Boolean Expression AND")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc7() { Load("xslt_mutith_boolean_expr_and.xsl", "xslt_mutith_boolean_expr_and.xml"); @@ -218,7 +218,7 @@ public void proc7() } //[Variation("Multiple Transform(): Reader - Boolean Expression OR")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc8() { Load("xslt_mutith_boolean_expr_or.xsl", "xslt_mutith_boolean_expr_or.xml"); @@ -238,7 +238,7 @@ public void proc8() } //[Variation("Multiple Transform(): Reader - FormatNumber function")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc9() { Load("xslt_mutith_format_number.xsl", "xslt_mutith_format_number.xml"); @@ -258,7 +258,7 @@ public void proc9() } //[Variation("Multiple Transform(): Reader - Position() function")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc10() { Load("xslt_mutith_position_func.xsl", "xslt_mutith_position_func.xml"); @@ -278,7 +278,7 @@ public void proc10() } //[Variation("Multiple Transform(): Reader - preserve space")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc11() { Load("xslt_mutith_preserve_space.xsl", "xslt_mutith_preserve_space.xml"); @@ -298,7 +298,7 @@ public void proc11() } //[Variation("Multiple Transform(): Reader - Variable nodeset")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc12() { Load("xslt_mutith_variable_nodeset.xsl", "xslt_mutith_variable_nodeset.xml"); @@ -364,7 +364,7 @@ private void Load(string _strXslFile, string _strXmlFile) } //[Variation("Multiple Transform(): TextWriter - Basic Test")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc1() { Load("xslt_multithreading_test.xsl", "foo.xml"); @@ -384,7 +384,7 @@ public void proc1() } //[Variation("Multiple Transform(): TextWriter - QFE 505 Repro")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc2() { using (new AllowDefaultResolverContext()) @@ -405,7 +405,7 @@ public void proc2() } //[Variation("Multiple Transform(): TextWriter - AVTs")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc3() { Load("xslt_multith_AVTs.xsl", "xslt_multith_AVTs.xml"); @@ -425,7 +425,7 @@ public void proc3() } //[Variation("Multiple Transform(): TextWriter - xsl:key")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc4() { Load("xslt_multith_keytest.xsl", "xslt_multith_keytest.xml"); @@ -445,7 +445,7 @@ public void proc4() } //[Variation("Multiple Transform(): TextWriter - xsl:sort")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc5() { Load("xslt_multith_sorting.xsl", "xslt_multith_sorting.xml"); @@ -465,7 +465,7 @@ public void proc5() } //[Variation("Multiple Transform(): TextWriter - Attribute Sets")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc6() { Load("xslt_mutith_attribute_sets.xsl", "xslt_mutith_attribute_sets.xml"); @@ -485,7 +485,7 @@ public void proc6() } //[Variation("Multiple Transform(): TextWriter - Boolean Expression AND")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc7() { Load("xslt_mutith_boolean_expr_and.xsl", "xslt_mutith_boolean_expr_and.xml"); @@ -505,7 +505,7 @@ public void proc7() } //[Variation("Multiple Transform(): TextWriter - Boolean Expression OR")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc8() { Load("xslt_mutith_boolean_expr_or.xsl", "xslt_mutith_boolean_expr_or.xml"); @@ -525,7 +525,7 @@ public void proc8() } //[Variation("Multiple Transform(): TextWriter - FormatNumber function")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc9() { Load("xslt_mutith_format_number.xsl", "xslt_mutith_format_number.xml"); @@ -545,7 +545,7 @@ public void proc9() } //[Variation("Multiple Transform(): TextWriter - Position() function")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc10() { Load("xslt_mutith_position_func.xsl", "xslt_mutith_position_func.xml"); @@ -565,7 +565,7 @@ public void proc10() } //[Variation("Multiple Transform(): TextWriter - preserve space")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc11() { Load("xslt_mutith_preserve_space.xsl", "xslt_mutith_preserve_space.xml"); @@ -585,7 +585,7 @@ public void proc11() } //[Variation("Multiple Transform(): TextWriter - Variable nodeset")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc12() { Load("xslt_mutith_variable_nodeset.xsl", "xslt_mutith_variable_nodeset.xml"); diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs index bfa3788d0c9072..ef1e1b19c69a5d 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs @@ -104,7 +104,7 @@ public int GetParam2(object args) } //[Variation("Multiple GetParam for same parameter name")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc1() { CThreads rThreads = new CThreads(_output); @@ -122,7 +122,7 @@ public void proc1() } //[Variation("Multiple GetParam for different parameter name")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc2() { CThreads rThreads = new CThreads(_output); @@ -189,7 +189,7 @@ public int GetExtnObject2(object args) } //[Variation("Multiple GetExtensionObject for same namespace System.Xml.Tests")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc1() { CThreads rThreads = new CThreads(_output); @@ -207,7 +207,7 @@ public void proc1() } //[Variation("Multiple GetExtensionObject for different namespace System.Xml.Tests")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc2() { CThreads rThreads = new CThreads(_output); @@ -275,7 +275,7 @@ public int SharedArgList(object args) // Multiple Transform() using shared ArgumentList //////////////////////////////////////////////////////////////// //[Variation("Multiple transforms using shared ArgumentList")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc1() { CThreads rThreads = new CThreads(_output); diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs index 7caf4550a068e8..42fea0b050e9df 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs @@ -76,7 +76,7 @@ public virtual int Transform(object args) [InlineData("xslt_mutith_variable_global_forward_ref_deep.xsl", "xslt_mutith_variable_nodeset.xml")] //[Variation("Local and global variables", Params = new object[] { "xslt_mutith_variable_local_and_global.xsl", "xslt_mutith_variable_local_and_global.xsl" })] [InlineData("xslt_mutith_variable_local_and_global.xsl", "xslt_mutith_variable_local_and_global.xsl")] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Variations(object param0, object param1) { string xslFile = (string)param0; diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs index ae2927e4308696..d9023ca05dc656 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs @@ -104,7 +104,7 @@ public int GetParam2(object args) } //[Variation("Multiple GetParam for same parameter name")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc1() { CThreads rThreads = new CThreads(_output); @@ -122,7 +122,7 @@ public void proc1() } //[Variation("Multiple GetParam for different parameter name")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc2() { CThreads rThreads = new CThreads(_output); @@ -188,7 +188,7 @@ public int GetExtnObject2(object args) } //[Variation("Multiple GetExtensionObject for same namespace System.Xml.Tests")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc1() { CThreads rThreads = new CThreads(_output); @@ -206,7 +206,7 @@ public void proc1() } //[Variation("Multiple GetExtensionObject for different namespace System.Xml.Tests")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc2() { CThreads rThreads = new CThreads(_output); @@ -274,7 +274,7 @@ public int SharedArgList(object args) // Multiple Transform() using shared ArgumentList //////////////////////////////////////////////////////////////// //[Variation("Multiple transforms using shared ArgumentList")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void proc1() { CThreads rThreads = new CThreads(_output); diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs index 042395ef74590f..8657228138c49a 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs @@ -3218,7 +3218,7 @@ public void Handles() Assert.Equal(handle.RowId, assemblyRef.RowId); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void CanReadFromSameMemoryMappedPEReaderInParallel() { // See http://roslyn.codeplex.com/workitem/299 diff --git a/src/libraries/System.Reflection.Metadata/tests/Utilities/AbstractMemoryBlockTests.cs b/src/libraries/System.Reflection.Metadata/tests/Utilities/AbstractMemoryBlockTests.cs index 0a507c62c2d5a1..9fb9dc8a653257 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Utilities/AbstractMemoryBlockTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Utilities/AbstractMemoryBlockTests.cs @@ -116,7 +116,7 @@ public void Stream() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34493", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public void FileStream() { @@ -191,7 +191,7 @@ private class TestOnceDisposable : IDisposable public void Dispose() => Assert.Equal(1, Interlocked.Increment(ref _i)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public unsafe void DisposeThreadSafety() { var nativeBlocks = new NativeHeapMemoryBlock[20]; diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSExportTest.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSExportTest.cs index 33bed2a64d6481..ca1e4b7a7d66b9 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSExportTest.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSExportTest.cs @@ -14,7 +14,7 @@ namespace System.Runtime.InteropServices.JavaScript.Tests { public class JSExportAsyncTest : JSInteropTestBase, IAsyncLifetime { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void SyncJsImportJsExportThrows() { var ex = Assert.Throws(()=>JavaScriptTestHelper.invoke1_Boolean(true, nameof(JavaScriptTestHelper.EchoBoolean))); @@ -50,7 +50,7 @@ public async Task JsExportInt32DiscardNoWait(int value) } } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public class JSExportTest : JSInteropTestBase, IAsyncLifetime { [Theory] @@ -452,7 +452,7 @@ public async Task JsExportCompletedTaskOfBigLong(long value) Assert.Equal(value, rr); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsExportCallback_FunctionIntInt() { int called = -1; @@ -468,7 +468,7 @@ public void JsExportCallback_FunctionIntInt() Assert.Equal(42, called); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsExportCallback_FunctionIntIntThrow() { int called = -1; @@ -485,7 +485,7 @@ public void JsExportCallback_FunctionIntIntThrow() Assert.Same(expected, actual); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public async Task JsExportFunctionDateTimeDateTime() { DateTime input = DateTime.Now; @@ -563,7 +563,7 @@ public async Task JsExportDateTime_ReturnValue_OverflowNETDateTime() Assert.Equal("Error: Assert failed: Overflow: value +275760-09-13T00:00:00.000Z is out of 0001-01-01T00:00:00.000Z 9999-12-31T23:59:59.999Z range", ex.Message); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public async Task JsExportFuncOfDateTime_Argument_OverflowNETDateTime() { DateTime receivedArg = DateTime.MinValue; @@ -574,7 +574,7 @@ public async Task JsExportFuncOfDateTime_Argument_OverflowNETDateTime() Assert.Equal(DateTime.MinValue, receivedArg); // delegate invoke failed, no change to arg } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsExportCallback_FunctionLongLong_OverflowInt52_JSSide() { long called = -1; @@ -587,7 +587,7 @@ public void JsExportCallback_FunctionLongLong_OverflowInt52_JSSide() Assert.Equal("Error: Assert failed: Value is not an integer: 9007199254740992 (number)", ex.Message); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsExportCallback_FunctionLongLong_OverflowInt52_NETSide() { long called = -1; diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs index 2a8cbc1b8fe006..b1b13cbf1af5c5 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs @@ -127,7 +127,7 @@ public async Task RejectNull() var ex = await Assert.ThrowsAsync(() => JavaScriptTestHelper.Reject(null)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public unsafe void OptimizedPaths() { JavaScriptTestHelper.optimizedReached = 0; @@ -1102,7 +1102,7 @@ public async Task JsImportSleep() await JavaScriptTestHelper.sleep(100); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] // slow + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] // slow public async Task JsImportTaskTypes() { for (int i = 0; i < 100; i++) @@ -1308,7 +1308,7 @@ public async Task JsImportResolvedPromiseReturnsCompletedTask() #region Action - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportCallback_EchoAction() { bool called = false; @@ -1323,7 +1323,7 @@ public void JsImportCallback_EchoAction() Assert.True(called); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void JsImportCallback_EchoActionThrows_MT() { bool called = false; @@ -1376,7 +1376,7 @@ public async Task JsImportCallback_EchoActionMany() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportCallback_Action() { bool called = false; @@ -1387,7 +1387,7 @@ public void JsImportCallback_Action() Assert.True(called); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportEcho_ActionAction() { bool called = false; @@ -1400,7 +1400,7 @@ public void JsImportEcho_ActionAction() Assert.True(called); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportEcho_ActionIntActionInt() { int calledA = -1; @@ -1413,7 +1413,7 @@ public void JsImportEcho_ActionIntActionInt() Assert.Equal(42, calledA); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportCallback_ActionInt() { int called = -1; @@ -1424,7 +1424,7 @@ public void JsImportCallback_ActionInt() Assert.Equal(42, called); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportCallback_FunctionIntInt() { int called = -1; @@ -1437,7 +1437,7 @@ public void JsImportCallback_FunctionIntInt() Assert.Equal(42, res); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportBackCallback_FunctionIntInt() { int called = -1; @@ -1452,7 +1452,7 @@ public void JsImportBackCallback_FunctionIntInt() Assert.Equal(84, called); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportBackCallback_FunctionIntIntIntInt() { int calledA = -1; @@ -1471,7 +1471,7 @@ public void JsImportBackCallback_FunctionIntIntIntInt() Assert.Equal(84, calledB); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportCallback_ActionIntInt() { int calledA = -1; @@ -1485,7 +1485,7 @@ public void JsImportCallback_ActionIntInt() Assert.Equal(43, calledB); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportCallback_ActionLongLong() { long calledA = -1; @@ -1499,7 +1499,7 @@ public void JsImportCallback_ActionLongLong() Assert.Equal(43, calledB); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportCallback_ActionIntLong() { int calledA = -1; @@ -1513,7 +1513,7 @@ public void JsImportCallback_ActionIntLong() Assert.Equal(43, calledB); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportCallback_ActionIntLongDouble() { int calledA = -1; @@ -1530,7 +1530,7 @@ public void JsImportCallback_ActionIntLongDouble() Assert.Equal(44.5, calledC); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public void JsImportCallback_ActionIntThrow() { int called = -1; diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/TimerTests.cs b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/TimerTests.cs index f862bf5a4b043e..3621a3d1f6c2a3 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/TimerTests.cs +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/TimerTests.cs @@ -24,7 +24,7 @@ public static IEnumerable TestCases() [ActiveIssue("https://github.com/dotnet/runtime/issues/115763")] [MemberData(nameof(TestCases))] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] // this test only makes sense with ST TimerQueue + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] // this test only makes sense with ST TimerQueue public async Task TestTimers(int[] timeouts, int? expectedSetCounter, int? expectedSetCounterAfterCleanUp, int? expectedHitCount) { int wasCalled = 0; diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs index 8cd8f01e9f22e8..f2fd4fb612092a 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void XmlBaseWriter_CheckAsync_ThrowInvalidOperationException() { int byteSize = 1024; diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 65b98d13078b29..2624d617c3fda2 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -14158,6 +14158,8 @@ public static partial class RuntimeFeature public static bool IsDynamicCodeCompiled { get { throw null; } } [System.Diagnostics.CodeAnalysis.FeatureSwitchDefinitionAttribute("System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported")] public static bool IsDynamicCodeSupported { get { throw null; } } + [System.Diagnostics.CodeAnalysis.FeatureSwitchDefinitionAttribute("System.Runtime.CompilerServices.RuntimeFeature.IsMultithreadingSupported")] + public static bool IsMultithreadingSupported { get { throw null; } } public static bool IsSupported(string feature) { throw null; } } public static partial class RuntimeHelpers 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 15e096360bf92a..a2bb4c282c02c4 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.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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..f82f5b090aef0d 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 @@ -11,7 +11,7 @@ namespace System.Globalization.Tests { public class CultureInfoAsync { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void TestCurrentCulturesAsync() { var newCurrentCulture = new CultureInfo(CultureInfo.CurrentCulture.Name.Equals("ja-JP", StringComparison.OrdinalIgnoreCase) ? "en-US" : "ja-JP"); @@ -29,7 +29,7 @@ public void TestCurrentCulturesAsync() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.Globalization.Tests/CultureInfo/CultureInfoNames.cs b/src/libraries/System.Runtime/tests/System.Globalization.Tests/CultureInfo/CultureInfoNames.cs index b4ba35adb85e4b..3c6f5af1592c2a 100644 --- a/src/libraries/System.Runtime/tests/System.Globalization.Tests/CultureInfo/CultureInfoNames.cs +++ b/src/libraries/System.Runtime/tests/System.Globalization.Tests/CultureInfo/CultureInfoNames.cs @@ -13,7 +13,7 @@ public class CultureInfoNames // Android has its own ICU, which doesn't 100% map to UsingLimitedCultures // Browser uses JS to get the NativeName that is missing in ICU (in the singlethreaded runtime only) private static bool SupportFullIcuResources => - !PlatformDetection.IsWasi && !PlatformDetection.IsAndroid && PlatformDetection.IsIcuGlobalization && !PlatformDetection.IsWasmThreadingSupported; + !PlatformDetection.IsWasi && !PlatformDetection.IsAndroid && PlatformDetection.IsIcuGlobalization && !PlatformDetection.IsMultithreadingSupported; public static IEnumerable SupportedCultures_TestData() { diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/ReadWriteAllLinesAsync.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/ReadWriteAllLinesAsync.cs index 0dc72cab3f42f0..1d688066517420 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/ReadWriteAllLinesAsync.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/ReadWriteAllLinesAsync.cs @@ -44,7 +44,7 @@ public async Task NullLinesAsync() Assert.Equal(new string[] { "" }, await ReadAsync(path)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task EmptyStringCreatesFileAsync() { string path = GetTestFilePath(); @@ -53,7 +53,7 @@ public async Task EmptyStringCreatesFileAsync() Assert.Empty(await ReadAsync(path)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0)] [InlineData(100)] public async Task ValidWriteAsync(int size) diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/ReadWriteAllTextAsync.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/ReadWriteAllTextAsync.cs index 723ed95aa5da7f..505b6789ea16c6 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/ReadWriteAllTextAsync.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/File/ReadWriteAllTextAsync.cs @@ -36,7 +36,7 @@ public async Task NullParametersAsync() public Task NonExistentPathAsync() => Assert.ThrowsAsync( async () => await WriteAsync(Path.Combine(TestDirectory, GetTestFileName(), GetTestFileName()), "Text")); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task NullContent_CreatesFileAsync() { string path = GetTestFilePath(); 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..672d4f127f3c24 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 @@ -29,7 +29,7 @@ public void DisposeHandleThenUseFileStream_CopyToAsync(bool useAsync) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // inner loop, just a few cases + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // inner loop, just a few cases [InlineData(false, false)] [InlineData(true, false)] [InlineData(true, true)] @@ -40,7 +40,7 @@ public Task File_AllDataCopied_InnerLoop(bool useAsync, bool preWrite) bufferSize: 4096, writeSize: 1024, numWrites: 10); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // outer loop, many combinations + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // outer loop, many combinations [OuterLoop] [MemberData(nameof(File_AllDataCopied_MemberData))] public async Task File_AllDataCopied( @@ -135,7 +135,7 @@ public static IEnumerable File_AllDataCopied_MemberData() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task DerivedFileStream_ReadAsyncInvoked(bool useAsync) diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/DeleteOnClose.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/DeleteOnClose.cs index cec39c94e64e43..8d6d83c71da13d 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/DeleteOnClose.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/DeleteOnClose.cs @@ -10,7 +10,7 @@ namespace System.IO.Tests { public class FileStream_DeleteOnClose : FileSystemTest { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsFileLockingEnabled), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsFileLockingEnabled), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] public async Task OpenOrCreate_DeleteOnClose_UsableAsMutex() { diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ReadAsync.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ReadAsync.cs index 40220b45ef875a..efe15b17083770 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ReadAsync.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ReadAsync.cs @@ -65,7 +65,7 @@ public async Task ReadAsyncBufferedCompletesSynchronously() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0, true)] // 0 == no buffering [InlineData(4096, true)] // 4096 == default buffer size [InlineData(0, false)] @@ -99,7 +99,7 @@ public async Task ReadAsyncCanceledFile(int bufferSize, bool isAsync) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(FileShare.None, FileOptions.Asynchronous)] // FileShare.None: exclusive access [InlineData(FileShare.ReadWrite, FileOptions.Asynchronous)] // FileShare.ReadWrite: others can write to the file, the length can't be cached [InlineData(FileShare.None, FileOptions.None)] @@ -131,7 +131,7 @@ public async Task IncompleteReadCantSetPositionBeyondEndOfFile(FileShare fileSha } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(true, true)] [InlineData(true, false)] [InlineData(false, false)] diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/WriteAsync.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/WriteAsync.cs index 13f872909ab6cb..4b094f35228e56 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/WriteAsync.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/WriteAsync.cs @@ -182,7 +182,7 @@ public static IEnumerable MemberData_FileStreamAsyncWriting() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // Browser PNSE: Cannot wait on monitors + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] // Browser PNSE: Cannot wait on monitors [PlatformSpecific(TestPlatforms.Windows)] public Task ManyConcurrentWriteAsyncs() { @@ -197,7 +197,7 @@ public Task ManyConcurrentWriteAsyncs() numWrites: 10); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [PlatformSpecific(TestPlatforms.Windows)] // testing undocumented feature that's legacy in the Windows implementation [MemberData(nameof(MemberData_FileStreamAsyncWriting))] [OuterLoop] // many combinations: we test just one in inner loop and the rest outer diff --git a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ctor_str_fm_fa_fs_buffer_fo.cs b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ctor_str_fm_fa_fs_buffer_fo.cs index c2e4666992e7c6..54a7d3043472ba 100644 --- a/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ctor_str_fm_fa_fs_buffer_fo.cs +++ b/src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/FileStream/ctor_str_fm_fa_fs_buffer_fo.cs @@ -26,7 +26,7 @@ public void InvalidFileOptionsThrow() () => CreateFileStream(GetTestFilePath(), FileMode.Create, FileAccess.ReadWrite, FileShare.Read, c_DefaultBufferSize, ~FileOptions.None)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(FileOptions.None)] [InlineData(FileOptions.DeleteOnClose)] [InlineData(FileOptions.RandomAccess)] @@ -68,7 +68,7 @@ public void ValidFileOptions(FileOptions option) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(FileOptions.Encrypted)] [InlineData(FileOptions.Asynchronous | FileOptions.Encrypted)] [InlineData(FileOptions.Asynchronous | FileOptions.DeleteOnClose | FileOptions.Encrypted | FileOptions.RandomAccess | FileOptions.SequentialScan | FileOptions.WriteThrough)] diff --git a/src/libraries/System.Runtime/tests/System.IO.Tests/BufferedStream/BufferedStreamTests.cs b/src/libraries/System.Runtime/tests/System.IO.Tests/BufferedStream/BufferedStreamTests.cs index 009d3a0e51025f..dd64888d830deb 100644 --- a/src/libraries/System.Runtime/tests/System.IO.Tests/BufferedStream/BufferedStreamTests.cs +++ b/src/libraries/System.Runtime/tests/System.IO.Tests/BufferedStream/BufferedStreamTests.cs @@ -239,7 +239,7 @@ public static IEnumerable SetPosMethods } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ConcurrentOperationsAreSerialized() { byte[] data = Enumerable.Range(0, 1000).Select(i => unchecked((byte)i)).ToArray(); @@ -281,9 +281,9 @@ public void UnderlyingStreamThrowsExceptions() [InlineData(true)] public async Task CopyToTest_RequiresFlushingOfWrites(bool copyAsynchronously) { - if (copyAsynchronously && !PlatformDetection.IsThreadingSupported) + if (copyAsynchronously && !PlatformDetection.IsMultithreadingSupported) { - throw new SkipTestException(nameof(PlatformDetection.IsThreadingSupported)); + throw new SkipTestException(nameof(PlatformDetection.IsMultithreadingSupported)); } byte[] data = Enumerable.Range(0, 1000).Select(i => (byte)(i % 256)).ToArray(); diff --git a/src/libraries/System.Runtime/tests/System.IO.Tests/Stream/Stream.CopyToTests.cs b/src/libraries/System.Runtime/tests/System.IO.Tests/Stream/Stream.CopyToTests.cs index 7c0d860c34c0d9..e2937a9426c44a 100644 --- a/src/libraries/System.Runtime/tests/System.IO.Tests/Stream/Stream.CopyToTests.cs +++ b/src/libraries/System.Runtime/tests/System.IO.Tests/Stream/Stream.CopyToTests.cs @@ -40,7 +40,7 @@ public void IfCanSeekIsFalseLengthAndPositionShouldNotBeCalled() Assert.InRange(outerCount, 1, int.MaxValue); // the buffer can't be size 0 } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task AsyncIfCanSeekIsFalseLengthAndPositionShouldNotBeCalled() { var baseStream = new DelegateStream( @@ -80,7 +80,7 @@ public void IfCanSeekIsTrueLengthAndPositionShouldOnlyBeCalledOnce() Assert.InRange(trackingStream.TimesCalled(nameof(trackingStream.Position)), 0, 1); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task AsyncIfCanSeekIsTrueLengthAndPositionShouldOnlyBeCalledOnce() { var baseStream = new DelegateStream( @@ -133,7 +133,7 @@ public void IfLengthIsLessThanOrEqualToPositionCopyToShouldStillBeCalledWithAPos Assert.InRange(outerCount, 1, int.MaxValue); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(LengthIsLessThanOrEqualToPosition))] public async Task AsyncIfLengthIsLessThanOrEqualToPositionCopyToShouldStillBeCalledWithAPositiveBufferSize(long length, long position) { @@ -188,7 +188,7 @@ public void IfLengthMinusPositionPositiveOverflowsBufferSizeShouldStillBePositiv Assert.InRange(outerCount, 1, int.MaxValue); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(LengthMinusPositionPositiveOverflows))] public async Task AsyncIfLengthMinusPositionPositiveOverflowsBufferSizeShouldStillBePositive(long length, long position) { @@ -267,7 +267,7 @@ public void IfLengthIsGreaterThanPositionAndDoesNotOverflowEverythingShouldGoNor Assert.Equal(ReadLimit - 1, dest.TimesCalled(nameof(dest.Write))); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(LengthIsGreaterThanPositionAndDoesNotOverflow))] public async Task AsyncIfLengthIsGreaterThanPositionAndDoesNotOverflowEverythingShouldGoNormally(long length, long position) { diff --git a/src/libraries/System.Runtime/tests/System.IO.Tests/StreamReader/StreamReader.cs b/src/libraries/System.Runtime/tests/System.IO.Tests/StreamReader/StreamReader.cs index efdf66257c31c7..296e7de14ce28d 100644 --- a/src/libraries/System.Runtime/tests/System.IO.Tests/StreamReader/StreamReader.cs +++ b/src/libraries/System.Runtime/tests/System.IO.Tests/StreamReader/StreamReader.cs @@ -30,7 +30,7 @@ public void ObjectClosedReadLineBaseStream() } // single-threaded WASM bypasses SyncTextWriter for faster startup - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Synchronized_NewObject() { using (Stream str = GetLargeStream()) diff --git a/src/libraries/System.Runtime/tests/System.IO.Tests/StreamWriter/StreamWriter.cs b/src/libraries/System.Runtime/tests/System.IO.Tests/StreamWriter/StreamWriter.cs index 0abbc4d6add34d..ab3f7e36c3deb2 100644 --- a/src/libraries/System.Runtime/tests/System.IO.Tests/StreamWriter/StreamWriter.cs +++ b/src/libraries/System.Runtime/tests/System.IO.Tests/StreamWriter/StreamWriter.cs @@ -8,7 +8,7 @@ namespace System.IO.Tests public partial class WriteTests { // single-threaded WASM bypasses SyncTextWriter for faster startup - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Synchronized_NewObject() { using (Stream str = CreateStream()) diff --git a/src/libraries/System.Runtime/tests/System.IO.Tests/TextReader/TextReaderTests.cs b/src/libraries/System.Runtime/tests/System.IO.Tests/TextReader/TextReaderTests.cs index d18e477153d6d7..5fe782bc1719dc 100644 --- a/src/libraries/System.Runtime/tests/System.IO.Tests/TextReader/TextReaderTests.cs +++ b/src/libraries/System.Runtime/tests/System.IO.Tests/TextReader/TextReaderTests.cs @@ -44,7 +44,7 @@ public void NotEndOfStream() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ReadToEndAsync() { using (CharArrayTextReader tr = new CharArrayTextReader(TestDataProvider.LargeData)) @@ -55,7 +55,7 @@ public async Task ReadToEndAsync() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ReadToEndAsync_WithCancellationToken() { using var tr = new CharArrayTextReader(TestDataProvider.LargeData); @@ -63,7 +63,7 @@ public async Task ReadToEndAsync_WithCancellationToken() Assert.Equal(5000, result.Length); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ReadToEndAsync_WithCanceledCancellationToken() { using var tr = new CharArrayTextReader(TestDataProvider.LargeData); @@ -182,7 +182,7 @@ public void ReadBlockCharArr() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ReadBlockAsyncCharArr() { (char[] chArr, CharArrayTextReader textReader) baseInfo = GetCharArray(); @@ -200,7 +200,7 @@ public async Task ReadBlockAsyncCharArr() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ReadAsync() { (char[] chArr, CharArrayTextReader textReader) baseInfo = GetCharArray(); @@ -256,7 +256,7 @@ public void ReadLines2() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task ReadLineAsyncContinuousNewLinesAndTabs() { char[] newLineTabData = new char[] { '\n', '\n', '\r', '\r', '\n' }; diff --git a/src/libraries/System.Runtime/tests/System.IO.Tests/TextWriter/TextWriterTests.cs b/src/libraries/System.Runtime/tests/System.IO.Tests/TextWriter/TextWriterTests.cs index f8714b2aedee0e..93da43eeb0c7b4 100644 --- a/src/libraries/System.Runtime/tests/System.IO.Tests/TextWriter/TextWriterTests.cs +++ b/src/libraries/System.Runtime/tests/System.IO.Tests/TextWriter/TextWriterTests.cs @@ -513,7 +513,7 @@ public void WriteLineStringMultipleObjectsSpanTest() #region Write Async Overloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteAsyncCharTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -523,7 +523,7 @@ public async Task WriteAsyncCharTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteAsyncRuneTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -533,7 +533,7 @@ public async Task WriteAsyncRuneTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteAsyncStringTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -544,7 +544,7 @@ public async Task WriteAsyncStringTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteAsyncCharArrayIndexCountTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -558,7 +558,7 @@ public async Task WriteAsyncCharArrayIndexCountTest() #region WriteLineAsync Overloads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteLineAsyncTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -568,7 +568,7 @@ public async Task WriteLineAsyncTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteLineAsyncCharTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -578,7 +578,7 @@ public async Task WriteLineAsyncCharTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteLineAsyncRuneTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -588,7 +588,7 @@ public async Task WriteLineAsyncRuneTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteLineAsyncStringTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -599,7 +599,7 @@ public async Task WriteLineAsyncStringTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteLineAsyncCharArrayIndexCount() { using (CharArrayTextWriter tw = NewTextWriter) @@ -633,7 +633,7 @@ public void WriteLineCharSpanTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteCharMemoryTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -644,7 +644,7 @@ public async Task WriteCharMemoryTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteLineCharMemoryTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -691,9 +691,9 @@ public async Task WriteAsyncStringBuilderTest(bool isSynchronized, TestStringBui { StringBuilder testData = GetTestStringBuilder(testStringBuilderKind); - if (!isSynchronized && !PlatformDetection.IsThreadingSupported) + if (!isSynchronized && !PlatformDetection.IsMultithreadingSupported) { - throw new SkipTestException(nameof(PlatformDetection.IsThreadingSupported)); + throw new SkipTestException(nameof(PlatformDetection.IsMultithreadingSupported)); } using (CharArrayTextWriter ctw = NewTextWriter) @@ -711,9 +711,9 @@ public async Task WriteLineAsyncStringBuilderTest(bool isSynchronized, TestStrin { StringBuilder testData = GetTestStringBuilder(testStringBuilderKind); - if (!isSynchronized && !PlatformDetection.IsThreadingSupported) + if (!isSynchronized && !PlatformDetection.IsMultithreadingSupported) { - throw new SkipTestException(nameof(PlatformDetection.IsThreadingSupported)); + throw new SkipTestException(nameof(PlatformDetection.IsMultithreadingSupported)); } using (CharArrayTextWriter ctw = NewTextWriter) @@ -725,7 +725,7 @@ public async Task WriteLineAsyncStringBuilderTest(bool isSynchronized, TestStrin } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteAsyncStringWithCancellationTokenTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -736,7 +736,7 @@ public async Task WriteAsyncStringWithCancellationTokenTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteAsyncStringWithCancellationTokenNullTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -746,7 +746,7 @@ public async Task WriteAsyncStringWithCancellationTokenNullTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteAsyncStringWithCancellationTokenCanceledTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -757,7 +757,7 @@ public async Task WriteAsyncStringWithCancellationTokenCanceledTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteLineAsyncWithCancellationTokenTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -767,7 +767,7 @@ public async Task WriteLineAsyncWithCancellationTokenTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteLineAsyncWithCancellationTokenCanceledTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -778,7 +778,7 @@ public async Task WriteLineAsyncWithCancellationTokenCanceledTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteLineAsyncStringWithCancellationTokenTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -789,7 +789,7 @@ public async Task WriteLineAsyncStringWithCancellationTokenTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteLineAsyncStringWithCancellationTokenNullTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -799,7 +799,7 @@ public async Task WriteLineAsyncStringWithCancellationTokenNullTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WriteLineAsyncStringWithCancellationTokenCanceledTest() { using (CharArrayTextWriter tw = NewTextWriter) @@ -831,7 +831,7 @@ public void DisposeAsync_ExceptionReturnedInTask() } // single-threaded WASM bypasses SyncTextWriter for faster startup - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task FlushAsync_Precanceled() { Assert.Equal(TaskStatus.RanToCompletion, TextWriter.Null.FlushAsync(new CancellationToken(true)).Status); 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 b8d49982005c21..363af8c5286279 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.IsMultithreadingSupported))] 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..864f7fdf35cb00 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.IsMultithreadingSupported))] public void NoWorkQueuedIfNoHandlers() { RunWithoutSyncCtx(() => @@ -32,7 +32,7 @@ public void NoWorkQueuedIfNoHandlers() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void TargetsCurrentSynchronizationContext() { RunWithoutSyncCtx(() => @@ -47,7 +47,7 @@ public void TargetsCurrentSynchronizationContext() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void EventRaisedWithActionHandler() { RunWithoutSyncCtx(() => @@ -66,7 +66,7 @@ public void EventRaisedWithActionHandler() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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 59bbede230cb74..3ab2f0a090c853 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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 06487e90aec3e8..19f5638819078c 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 @@ -251,7 +251,7 @@ public static void Concurrent_AddMany_DropReferences() // no asserts, just makin } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_Add_Read_Remove_DifferentObjects() { var cwt = new ConditionalWeakTable(); @@ -270,7 +270,7 @@ public static void Concurrent_Add_Read_Remove_DifferentObjects() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_Add_Read_Remove_ValidateRemovedValue_DifferentObjects() { var cwt = new ConditionalWeakTable(); @@ -290,7 +290,7 @@ public static void Concurrent_Add_Read_Remove_ValidateRemovedValue_DifferentObje }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_GetOrAdd_Add_Read_Remove_DifferentObjects() { var cwt = new ConditionalWeakTable(); @@ -312,7 +312,7 @@ public static void Concurrent_GetOrAdd_Add_Read_Remove_DifferentObjects() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_GetOrAdd_Factory_Add_Read_Remove_DifferentObjects() { var cwt = new ConditionalWeakTable(); @@ -331,7 +331,7 @@ public static void Concurrent_GetOrAdd_Factory_Add_Read_Remove_DifferentObjects( }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_GetOrAdd_Factory_WithArg_Add_Read_Remove_DifferentObjects() { var cwt = new ConditionalWeakTable(); @@ -350,7 +350,7 @@ public static void Concurrent_GetOrAdd_Factory_WithArg_Add_Read_Remove_Different }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_GetValue_Read_Remove_DifferentObjects() { var cwt = new ConditionalWeakTable(); @@ -368,7 +368,7 @@ public static void Concurrent_GetValue_Read_Remove_DifferentObjects() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_GetOrAdd_Read_Remove_DifferentObjects() { var cwt = new ConditionalWeakTable(); @@ -386,7 +386,7 @@ public static void Concurrent_GetOrAdd_Read_Remove_DifferentObjects() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_GetOrAdd_Factory_Read_Remove_DifferentObjects() { var cwt = new ConditionalWeakTable(); @@ -404,7 +404,7 @@ public static void Concurrent_GetOrAdd_Factory_Read_Remove_DifferentObjects() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_GetOrAdd_Factory_WithArg_Read_Remove_DifferentObjects() { var cwt = new ConditionalWeakTable(); @@ -422,7 +422,7 @@ public static void Concurrent_GetOrAdd_Factory_WithArg_Read_Remove_DifferentObje }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_GetValue_Read_Remove_SameObject() { object key = new object(); @@ -440,7 +440,7 @@ public static void Concurrent_GetValue_Read_Remove_SameObject() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_GetOrAdd_Read_Remove_SameObject() { object key = new object(); @@ -458,7 +458,7 @@ public static void Concurrent_GetOrAdd_Read_Remove_SameObject() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_GetOrAdd_Factory_Read_Remove_SameObject() { object key = new object(); @@ -476,7 +476,7 @@ public static void Concurrent_GetOrAdd_Factory_Read_Remove_SameObject() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Concurrent_GetOrAdd_Factory_WithArg_Read_Remove_SameObject() { object key = new object(); diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs index f0d5d862806120..07ad2f53a11bb3 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs @@ -2683,7 +2683,7 @@ public static void TestTimeZoneIdBackwardCompatibility(string oldId, string curr // Note we cannot test the DisplayName, as it will contain the ID. } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWasmThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [PlatformSpecific(TestPlatforms.Browser)] [InlineData("America/Buenos_Aires")] [InlineData("America/Catamarca")] diff --git a/src/libraries/System.Runtime/tests/System.Security.SecureString.Tests/SecureStringTests.cs b/src/libraries/System.Runtime/tests/System.Security.SecureString.Tests/SecureStringTests.cs index 6fabfc8cfe3c1a..08b2533d587c15 100644 --- a/src/libraries/System.Runtime/tests/System.Security.SecureString.Tests/SecureStringTests.cs +++ b/src/libraries/System.Runtime/tests/System.Security.SecureString.Tests/SecureStringTests.cs @@ -447,7 +447,7 @@ public static void Grow_Large() [OuterLoop] [InlineData(5)] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void ThreadSafe_Stress(int executionTimeSeconds) // do some minimal verification that an instance can be used concurrently { using (var ss = new SecureString()) 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 8a2ae855c95196..1ca1b22c9e906c 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 @@ -88,7 +88,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.IsMultithreadingSupported))] [InlineData("default")] [InlineData("scheduler")] [InlineData("maxconcurrent")] @@ -184,7 +184,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.IsMultithreadingSupported))] [InlineData(4, 1, true)] [InlineData(1, 4, true)] [InlineData(4, 1, false)] @@ -259,7 +259,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.IsMultithreadingSupported))] public static void TestLowerConcurrencyLevel() { //a custom scheduler with maxConcurrencyLevel of one @@ -296,7 +296,7 @@ public static void TestLowerConcurrencyLevel() Task.WaitAll(taskList); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TestConcurrentBlockage() { ConcurrentExclusiveSchedulerPair schedPair = new ConcurrentExclusiveSchedulerPair(); @@ -329,7 +329,7 @@ public static void TestConcurrentBlockage() Task.WaitAll(taskList); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(ApiType))] public static void TestIntegration(string apiType, bool useReader) { @@ -363,7 +363,7 @@ public static void TestInvalidParameters() /// /// Test to ensure completion task works successfully /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TestCompletionTask() { // Completion tasks is valid after initialization @@ -416,7 +416,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.IsMultithreadingSupported))] [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 c309ec3f10ea2b..1adf0851d8a976 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 @@ -329,7 +329,7 @@ public static void CancellationTokenLateEnlistment() /// The signal occurs on a separate thread, and should happen after the wait begins. /// /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CancellationTokenWaitHandle_SignalAfterWait() { CancellationTokenSource tokenSource = new CancellationTokenSource(); @@ -536,7 +536,7 @@ public static void Enlist_EarlyAndLate() /// This test from donnya. Thanks Donny. /// /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void WaitAll() { Debug.WriteLine("WaitAll: Testing CancellationTokenTests.WaitAll, If Join does not work, then a deadlock will occur."); @@ -572,7 +572,7 @@ public static void BehaviourAfterCancelSignalled() tokenSource.Cancel(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Cancel_ThrowOnFirstException() { ManualResetEvent mre_CancelHasBeenEnacted = new ManualResetEvent(false); @@ -614,7 +614,7 @@ public static void Cancel_ThrowOnFirstException() Assert.NotNull(caughtException); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Cancel_DontThrowOnFirstException() { ManualResetEvent mre_CancelHasBeenEnacted = new ManualResetEvent(false); @@ -879,7 +879,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.IsMultithreadingSupported))] public static void DerivedCancellationTokenSource() { // Verify that a derived CTS is functional @@ -997,7 +997,7 @@ public static void DerivedCancellationTokenSource_Negative() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CancellationTokenSourceWithTimer() { TimeSpan bigTimeSpan = new TimeSpan(2000, 0, 0, 0, 0); @@ -1157,7 +1157,7 @@ public static void CancellationTokenSource_TryReset_UnregistersAll() Assert.Equal(cts.Token, ctr2.Token); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void EnlistWithSyncContext_BeforeCancel() { ManualResetEvent mre_CancelHasBeenEnacted = new ManualResetEvent(false); //synchronization helper @@ -1193,7 +1193,7 @@ public static void EnlistWithSyncContext_BeforeCancel() SetSynchronizationContext(prevailingSyncCtx); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void EnlistWithSyncContext_BeforeCancel_ThrowingExceptionInSyncContextDelegate() { ManualResetEvent mre_CancelHasBeenEnacted = new ManualResetEvent(false); //synchronization helper @@ -1240,7 +1240,7 @@ public static void EnlistWithSyncContext_BeforeCancel_ThrowingExceptionInSyncCon //Cleanup. SetSynchronizationContext(prevailingSyncCtx); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void EnlistWithSyncContext_BeforeCancel_ThrowingExceptionInSyncContextDelegate_ThrowOnFirst() { ManualResetEvent mre_CancelHasBeenEnacted = new ManualResetEvent(false); //synchronization helper @@ -1287,7 +1287,7 @@ public static void EnlistWithSyncContext_BeforeCancel_ThrowingExceptionInSyncCon // Test that we marshal exceptions back if we run callbacks on a sync context. // (This assumes that a syncContext.Send() may not be doing the marshalling itself). - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void SyncContextWithExceptionThrowingCallback() { Exception caughtEx1 = null; @@ -1333,7 +1333,7 @@ public static void SyncContextWithExceptionThrowingCallback() SetSynchronizationContext(prevailingSyncCtx); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Bug720327_DeregisterFromWithinACallbackIsSafe_SyncContextTest() { Debug.WriteLine("* CancellationTokenTests.Bug720327_DeregisterFromWithinACallbackIsSafe_SyncContextTest()"); @@ -1364,7 +1364,7 @@ public static void Bug720327_DeregisterFromWithinACallbackIsSafe_SyncContextTest SetSynchronizationContext(prevailingSyncCtx); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CancellationTokenRegistration_DisposeDuringCancellation_SuccessfullyRemovedIfNotYetInvoked() { var ctr0running = new ManualResetEventSlim(); @@ -1444,7 +1444,7 @@ public static void CancellationTokenRegistration_UnregisterRemovesDelegate() Assert.False(invoked); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CancellationTokenRegistration_UnregisterWhileCallbackRunning_UnregisterDoesntWaitForCallbackToComplete() { using (var barrier = new Barrier(2)) @@ -1466,7 +1466,7 @@ public static void CancellationTokenRegistration_UnregisterWhileCallbackRunning_ } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CancellationTokenRegistration_UnregisterDuringCancellation_SuccessfullyRemovedIfNotYetInvoked() { var ctr0running = new ManualResetEventSlim(); @@ -1501,7 +1501,7 @@ public static void CancellationTokenRegistration_UnregisterDuringCancellation_Su Assert.False(ctr1Invoked); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static async Task CancellationTokenRegistration_ConcurrentUnregisterWithCancel_ReturnsFalseOrCallbackInvoked() { using (Barrier barrier = new Barrier(2)) @@ -1550,7 +1550,7 @@ public static async Task CancellationTokenRegistration_ConcurrentUnregisterWithC } [OuterLoop("Runs for several seconds")] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Unregister_ConcurrentUse_ThreadSafe() { CancellationTokenRegistration reg = default; @@ -1664,7 +1664,7 @@ public static void CancellationTokenRegistration_DisposeAsyncRemovesDelegate() Assert.False(invoked); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static async Task CancellationTokenRegistration_DisposeAsyncWhileCallbackRunning_WaitsForCallbackToComplete() { using (var barrier = new Barrier(2)) @@ -1688,7 +1688,7 @@ public static async Task CancellationTokenRegistration_DisposeAsyncWhileCallback } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static async Task CancellationTokenRegistration_DisposeAsyncDuringCancellation_SuccessfullyRemovedIfNotYetInvoked() { var ctr0running = new ManualResetEventSlim(); @@ -1780,7 +1780,7 @@ public static void CancellationTokenSource_CancelAsync_NoRegistrations_CallbackC Assert.True(cts.IsCancellationRequested); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static async Task CancellationTokenSource_CancelAsync_CallbacksInvokedAsynchronously() { var cts = new CancellationTokenSource(); @@ -1798,7 +1798,7 @@ public static async Task CancellationTokenSource_CancelAsync_CallbacksInvokedAsy await t; } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CancellationTokenSource_CancelAsync_AllCallbacksInvoked() { const int Iters = 1000; 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 579662f96dc1f5..b6ce6699638af1 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void TaskWaitAny_WhenAny() { ManualResetEvent mre = new ManualResetEvent(false); @@ -294,7 +294,7 @@ public static async Task Task_WhenAny_TwoTasks_WakesOnFirstCompletion() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/99500", TestPlatforms.Browser)] public static void CancellationTokenRegitration() { @@ -312,7 +312,7 @@ public static void CancellationTokenRegitration() /// /// verify that the taskawaiter.UnsafeOnCompleted is invoked /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/99500", TestPlatforms.Browser)] public static void TaskAwaiter() { @@ -333,7 +333,7 @@ public static void TaskAwaiter() /// /// verify that the taskawaiter.UnsafeOnCompleted is invoked /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskConfigurableAwaiter() { ManualResetEvent mre = new ManualResetEvent(false); @@ -353,7 +353,7 @@ public static void TaskConfigurableAwaiter() /// /// FromAsync testing: Not supported in .NET Native /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void FromAsync() { Task emptyTask = new Task(() => { }); @@ -852,7 +852,7 @@ public static void Task_WhenAll_TwoTasks_WakesOnBothCompletionWithCancellationFo } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Task_WhenAll_TwoTasks_WakesOnBothCompletionWithSameCancellationForBoth() { // Non-generic, first completes first @@ -987,7 +987,7 @@ public static void Task_WhenAll_TwoTasks_WakesOnBothCompletionWithExceptionAndCa } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Task_WhenEach_NullsTriggerExceptions() { AssertExtensions.Throws("tasks", () => Task.WhenEach((Task[])null)); @@ -1003,7 +1003,7 @@ public void Task_WhenEach_NullsTriggerExceptions() AssertExtensions.Throws("tasks", () => Task.WhenEach((IEnumerable>)[null])); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Task_WhenEach_EmptyInputsCompleteImmediately() { Assert.False(await Task.WhenEach((Task[])[]).GetAsyncEnumerator().MoveNextAsync()); @@ -1014,7 +1014,7 @@ public async Task Task_WhenEach_EmptyInputsCompleteImmediately() Assert.False(await Task.WhenEach((IEnumerable>)[]).GetAsyncEnumerator().MoveNextAsync()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Task_WhenEach_TasksOnlyEnumerableOnce() { IAsyncEnumerable[] enumerables = @@ -1049,7 +1049,7 @@ public async Task Task_WhenEach_TasksOnlyEnumerableOnce() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(2)] 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 d803b0e6009a84..e3855b5981d3fa 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 @@ -455,7 +455,7 @@ public static void TrackedSyncContext_ValidateException() } // Running tasks with exceptions. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void FaultedTaskExceptions() { var twa1 = Task.Run(() => { throw new Exception("uh oh"); }); @@ -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.IsMultithreadingSupported))] public static void CancellationDoesntResultInEventFiring() { var cts = new CancellationTokenSource(); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/ConfiguredCancelableAsyncEnumerableTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/ConfiguredCancelableAsyncEnumerableTests.cs index 4366bb83fae4df..84822f1fd92976 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/ConfiguredCancelableAsyncEnumerableTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/System.Runtime.CompilerServices/ConfiguredCancelableAsyncEnumerableTests.cs @@ -98,7 +98,7 @@ public void ConfigureAwait_AwaitDisposeAsync_FlagsSetAppropriately(bool continue enumerable.Flags); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task CanBeEnumeratedWithStandardPattern() { IAsyncEnumerable asyncEnumerable = new EnumerableWithDelayToAsyncEnumerable(Enumerable.Range(1, 10), 1); 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..fcfda8200bdc77 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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 30234688656d00..fff21dc9ee664c 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.IsMultithreadingSupported))] public static void RunAsyncYieldAwaiterTests() { // Test direct usage works even though it's not encouraged @@ -145,14 +145,14 @@ public static void RunAsyncYieldAwaiterTests_Negative() SynchronizationContext.SetSynchronizationContext(null); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static async Task AsyncMethod_Yields_ReturnsToDefaultTaskScheduler() { await Task.Yield(); Assert.Same(TaskScheduler.Default, TaskScheduler.Current); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static async Task AsyncMethod_Yields_ReturnsToCorrectTaskScheduler() { QUWITaskScheduler ts = new QUWITaskScheduler(); @@ -166,7 +166,7 @@ await Task.Factory.StartNew(async delegate Assert.NotSame(ts, TaskScheduler.Current); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static async Task AsyncMethod_Yields_ReturnsToCorrectSynchronizationContext() { var sc = new ValidateCorrectContextSynchronizationContext (); 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 113b4e752625b8..ebb885abd50acb 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void SimpleAsyncEnumerable() { var source = new InstrumentedAsyncEnumerable(AsyncEnumerable.Range(0, 10)); @@ -59,7 +59,7 @@ public static void SimpleAsyncEnumerable() Assert.Equal(1, source.TotalDisposeAsyncCalls); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/99519", TestPlatforms.Browser)] public static void AsyncEnumerableWithDelays() { @@ -94,7 +94,7 @@ static async IAsyncEnumerable CreateSourceEnumerable() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/99519", TestPlatforms.Browser)] public static void AsyncEnumerableWithException() { @@ -123,7 +123,7 @@ static async IAsyncEnumerable CreateSourceEnumerable() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/99519", TestPlatforms.Browser)] public static void AsyncEnumerableWithCancellation() { diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/RunContinuationsAsynchronouslyTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/RunContinuationsAsynchronouslyTests.cs index 60dcca3c8a569c..b47f2db28750ad 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/RunContinuationsAsynchronouslyTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/RunContinuationsAsynchronouslyTests.cs @@ -7,7 +7,7 @@ namespace System.Threading.Tasks.Tests { public class RunContinuationsAsynchronouslyTests { - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void Direct(bool useRunContinuationsAsynchronously) @@ -15,7 +15,7 @@ public void Direct(bool useRunContinuationsAsynchronously) Run(useRunContinuationsAsynchronously, t => t); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void ViaUnwrap(bool useRunContinuationsAsynchronously) @@ -23,7 +23,7 @@ public void ViaUnwrap(bool useRunContinuationsAsynchronously) Run(useRunContinuationsAsynchronously, t => ((Task)t).Unwrap()); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void ViaWhenAll(bool useRunContinuationsAsynchronously) @@ -31,7 +31,7 @@ public void ViaWhenAll(bool useRunContinuationsAsynchronously) Run(useRunContinuationsAsynchronously, t => Task.WhenAll(t)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void ViaWhenAny(bool useRunContinuationsAsynchronously) diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskAPMTest.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskAPMTest.cs index 9fe6a65a8b37d0..dbc14712257f52 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskAPMTest.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskAPMTest.cs @@ -42,7 +42,7 @@ public sealed class TaskAPMTests : IDisposable /// private const int LongTaskMilliseconds = 100; - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] [InlineData(true)] [InlineData(false)] @@ -118,7 +118,7 @@ public void AsyncWaitHandle_DisposeHandleThenCompleteTask_Succeeds() tcs.SetResult(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] [InlineData(true)] [InlineData(false)] 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..16ef946c797b89 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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 7f0523765f0596..633701129f350c 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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 Task or Task) } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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 1cf816cbb616ae..58007fa05466e8 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.IsMultithreadingSupported))] 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 e6d1a390e2e15f..f95f3707cb9d1e 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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 5378301afeb7c5..c545846ef04285 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.IsMultithreadingSupported))] public static void RunContinueWithAsyncStateCheckTests() { Task t = new Task(() => { }); @@ -40,7 +40,7 @@ public static void RunContinueWithAsyncStateCheckTests() } // Stresses on multiple continuations from a single antecedent - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [SkipOnCoreClr("Stress test", ~RuntimeConfiguration.Release)] [SkipOnMono("Stress test")] public static void RunContinueWithStressTestsNoState() @@ -72,7 +72,7 @@ public static void RunContinueWithStressTestsNoState() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunContinueWithParamsTest_Cancellation() { // @@ -221,7 +221,7 @@ public static void RunContinueWithParamsTest_Cancellation() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithParamsTest_IllegalArgs() { Task t1 = new Task(delegate { }); @@ -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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunUnwrapTests_ExceptionTests() { Task taskRoot = null; @@ -883,7 +883,7 @@ public static void RunUnwrapTests_ExceptionTests() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunUnwrapTests_CancellationTests() { 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/99519", TestPlatforms.Browser)] public static void TestNoDeadlockOnContinueWith() { @@ -1093,7 +1093,7 @@ public static void TestNoDeadlockOnContinueWith() Debug.WriteLine("Success!"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunLazyCancellationTests() { for (int i = 0; i < 2; i++) @@ -1149,7 +1149,7 @@ public static void RunLazyCancellationTests() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunLazyCancellationTests_Negative() { for (int i = 0; i < 2; i++) @@ -1239,7 +1239,7 @@ public static void LongContinuationChain_ContinueWith_DoesNotStackOverflow() t.Wait(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void LongContinuationChain_Unwrap_DoesNotStackOverflow() { const int DiveDepth = 12_000; @@ -1255,7 +1255,7 @@ public static void LongContinuationChain_Unwrap_DoesNotStackOverflow() func(DiveDepth).Wait(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/99519", TestPlatforms.Browser)] public static void LongContinuationChain_Await_DoesNotStackOverflow() { @@ -1271,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.IsMultithreadingSupported))] [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 3a8f2168962b12..274aec02e3e60c 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunContinueWithTaskToTaskWithResult_NoneCompleted() { RunContinueWithTaskToTaskWithResult(TaskContinuationOptions.None); @@ -41,7 +41,7 @@ public static void RunContinueWithTaskToTaskWithResult_NoneCompleted() RunContinueWithTaskToTaskWithResult(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTask_NoneCompleted() { RunContinueWithTaskWithResultToTask(TaskContinuationOptions.None); @@ -51,7 +51,7 @@ public static void RunContinueWithTaskWithResultToTask_NoneCompleted() RunContinueWithTaskWithResultToTask(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTaskWithResult_NoneCompleted() { RunContinueWithTaskWithResultToTaskWithResult(TaskContinuationOptions.None); @@ -61,7 +61,7 @@ public static void RunContinueWithTaskWithResultToTaskWithResult_NoneCompleted() RunContinueWithTaskWithResultToTaskWithResult(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunContinueWithTaskToTaskWithResult_FaultedCanceled() { RunContinueWithTaskToTaskWithResult(s_onlyOnCanceled); @@ -81,7 +81,7 @@ public static void RunContinueWithTaskToTaskWithResult_FaultedCanceled() RunContinueWithTaskToTaskWithResult(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTask_FaultedCanceled() { RunContinueWithTaskWithResultToTask(s_onlyOnCanceled); @@ -91,7 +91,7 @@ public static void RunContinueWithTaskWithResultToTask_FaultedCanceled() RunContinueWithTaskWithResultToTask(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTaskWithResult_FaultedCanceled() { RunContinueWithTaskWithResultToTaskWithResult(s_onlyOnCanceled); @@ -102,7 +102,7 @@ public static void RunContinueWithTaskWithResultToTaskWithResult_FaultedCanceled } // Exception tests. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunContinueWithTaskToTaskWithResult_NoneCompleted_OnException() { RunContinueWithTaskToTaskWithResult(TaskContinuationOptions.None, true); @@ -122,7 +122,7 @@ public static void RunContinueWithTaskToTaskWithResult_NoneCompleted_OnException RunContinueWithTaskToTaskWithResult(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTask_NoneCompleted_OnException() { RunContinueWithTaskWithResultToTask(TaskContinuationOptions.None, true); @@ -132,7 +132,7 @@ public static void RunContinueWithTaskWithResultToTask_NoneCompleted_OnException RunContinueWithTaskWithResultToTask(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTaskWithResult_NoneCompleted_OnException() { RunContinueWithTaskWithResultToTaskWithResult(TaskContinuationOptions.None, true); @@ -142,7 +142,7 @@ public static void RunContinueWithTaskWithResultToTaskWithResult_NoneCompleted_O RunContinueWithTaskWithResultToTaskWithResult(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunContinueWithTaskToTaskWithResult_FaultedCanceled_OnException() { RunContinueWithTaskToTaskWithResult(s_onlyOnCanceled, true); @@ -161,7 +161,7 @@ public static void RunContinueWithTaskToTaskWithResult_FaultedCanceled_OnExcepti RunContinueWithTaskToTaskWithResult(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTask_FaultedCanceled_OnException() { RunContinueWithTaskWithResultToTask(s_onlyOnCanceled, true); @@ -171,7 +171,7 @@ public static void RunContinueWithTaskWithResultToTask_FaultedCanceled_OnExcepti RunContinueWithTaskWithResultToTask(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTaskWithResult_FaultedCanceled_OnException() { RunContinueWithTaskWithResultToTaskWithResult(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 a0aa3a13b45af7..54b1133bf909bf 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunContinueWithTaskToTaskWithResult_State() { RunContinueWithTaskToTaskWithResult_State_Helper(TaskContinuationOptions.None); @@ -41,7 +41,7 @@ public static void RunContinueWithTaskToTaskWithResult_State() RunContinueWithTaskToTaskWithResult_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTask_State() { RunContinueWithTaskWithResultToTask_State_Helper(TaskContinuationOptions.None); @@ -51,7 +51,7 @@ public static void RunContinueWithTaskWithResultToTask_State() RunContinueWithTaskWithResultToTask_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTaskWithResult_State() { RunContinueWithTaskWithResultToTaskWithResult_State_Helper(TaskContinuationOptions.None); @@ -61,7 +61,7 @@ public static void RunContinueWithTaskWithResultToTaskWithResult_State() RunContinueWithTaskWithResultToTaskWithResult_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunContinueWithTaskToTaskWithResult_State_FaultedCanceled() { RunContinueWithTaskToTaskWithResult_State_Helper(s_onlyOnCanceled); @@ -81,7 +81,7 @@ public static void RunContinueWithTaskToTaskWithResult_State_FaultedCanceled() RunContinueWithTaskToTaskWithResult_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTask_State_FaultedCanceled() { RunContinueWithTaskWithResultToTask_State_Helper(s_onlyOnCanceled); @@ -91,7 +91,7 @@ public static void RunContinueWithTaskWithResultToTask_State_FaultedCanceled() RunContinueWithTaskWithResultToTask_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTaskWithResult_State_FaultedCanceled() { RunContinueWithTaskWithResultToTaskWithResult_State_Helper(s_onlyOnCanceled); @@ -101,7 +101,7 @@ public static void RunContinueWithTaskWithResultToTaskWithResult_State_FaultedCa RunContinueWithTaskWithResultToTaskWithResult_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunContinueWithTaskToTaskWithResult_State_OnException() { RunContinueWithTaskToTaskWithResult_State_Helper(TaskContinuationOptions.None, true); @@ -121,7 +121,7 @@ public static void RunContinueWithTaskToTaskWithResult_State_OnException() RunContinueWithTaskToTaskWithResult_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTask_State_OnException() { RunContinueWithTaskWithResultToTask_State_Helper(TaskContinuationOptions.None, true); @@ -131,7 +131,7 @@ public static void RunContinueWithTaskWithResultToTask_State_OnException() RunContinueWithTaskWithResultToTask_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTaskWithResult_State_OnException() { RunContinueWithTaskWithResultToTaskWithResult_State_Helper(TaskContinuationOptions.None, true); @@ -141,7 +141,7 @@ public static void RunContinueWithTaskWithResultToTaskWithResult_State_OnExcepti RunContinueWithTaskWithResultToTaskWithResult_State_Helper(s_onlyOnRanToCompletion | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunContinueWithTaskToTaskWithResult_State_FaultedCanceled_OnException() { RunContinueWithTaskToTaskWithResult_State_Helper(s_onlyOnCanceled, true); @@ -161,7 +161,7 @@ public static void RunContinueWithTaskToTaskWithResult_State_FaultedCanceled_OnE RunContinueWithTaskToTaskWithResult_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTask_State_FaultedCanceled_OnException() { RunContinueWithTaskWithResultToTask_State_Helper(s_onlyOnCanceled, true); @@ -171,7 +171,7 @@ public static void RunContinueWithTaskWithResultToTask_State_FaultedCanceled_OnE RunContinueWithTaskWithResultToTask_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunContinueWithTaskWithResultToTaskWithResult_State_FaultedCanceled_OnException() { RunContinueWithTaskWithResultToTaskWithResult_State_Helper(s_onlyOnCanceled, true); @@ -181,7 +181,7 @@ public static void RunContinueWithTaskWithResultToTaskWithResult_State_FaultedCa RunContinueWithTaskWithResultToTaskWithResult_State_Helper(s_onlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously, true); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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 0963604a92da9e..41c068a9e26eb7 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.IsMultithreadingSupported))] public static void TaskCreateTest0() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -35,7 +35,7 @@ public static void TaskCreateTest0() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest1() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -50,7 +50,7 @@ public static void TaskCreateTest1() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest2() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -65,7 +65,7 @@ public static void TaskCreateTest2() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest3() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -80,7 +80,7 @@ public static void TaskCreateTest3() test.CreateTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest4() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -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.IsMultithreadingSupported))] public static void TaskCreateTest5() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -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.IsMultithreadingSupported))] public static void TaskCreateTest6() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -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.IsMultithreadingSupported))] public static void TaskCreateTest7() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -137,7 +137,7 @@ public static void TaskCreateTest7() test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest8() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -152,7 +152,7 @@ public static void TaskCreateTest8() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest9() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -167,7 +167,7 @@ public static void TaskCreateTest9() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest10() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -182,7 +182,7 @@ public static void TaskCreateTest10() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest11() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -197,7 +197,7 @@ public static void TaskCreateTest11() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest12() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -212,7 +212,7 @@ public static void TaskCreateTest12() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest13() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -227,7 +227,7 @@ public static void TaskCreateTest13() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest14() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -242,7 +242,7 @@ public static void TaskCreateTest14() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest15() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -257,7 +257,7 @@ public static void TaskCreateTest15() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest16() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -272,7 +272,7 @@ public static void TaskCreateTest16() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest17() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -287,7 +287,7 @@ public static void TaskCreateTest17() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest18() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -302,7 +302,7 @@ public static void TaskCreateTest18() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest19() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -317,7 +317,7 @@ public static void TaskCreateTest19() test.StartTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest20() { TestParameters parameters = new TestParameters(TaskType.TaskWithResultT) @@ -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.IsMultithreadingSupported))] public static void TaskCreateTest21() { TestParameters parameters = new TestParameters(TaskType.TaskWithResult) @@ -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.IsMultithreadingSupported))] public static void TaskCreateTest22() { TestParameters parameters = new TestParameters(TaskType.TaskWithResult) @@ -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.IsMultithreadingSupported))] public static void TaskCreateTest23() { TestParameters parameters = new TestParameters(TaskType.TaskWithResult) @@ -374,7 +374,7 @@ public static void TaskCreateTest23() test.ExceptionTests(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest24() { TestParameters parameters = new TestParameters(TaskType.TaskWithResult) @@ -389,7 +389,7 @@ public static void TaskCreateTest24() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest25() { TestParameters parameters = new TestParameters(TaskType.TaskWithResult) @@ -404,7 +404,7 @@ public static void TaskCreateTest25() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest26() { TestParameters parameters = new TestParameters(TaskType.TaskWithResult) @@ -419,7 +419,7 @@ public static void TaskCreateTest26() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest27() { TestParameters parameters = new TestParameters(TaskType.TaskWithResult) @@ -434,7 +434,7 @@ public static void TaskCreateTest27() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest28() { TestParameters parameters = new TestParameters(TaskType.TaskWithResult) @@ -449,7 +449,7 @@ public static void TaskCreateTest28() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskCreateTest29() { TestParameters parameters = new TestParameters(TaskType.TaskWithResult) @@ -464,7 +464,7 @@ public static void TaskCreateTest29() test.StartNewTask(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void TaskCreateTest54() { TestParameters parameters = new TestParameters(TaskType.Task) diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskDisposeTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskDisposeTests.cs index 8eadcf887f4c77..c5266967e64b56 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskDisposeTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/Task/TaskDisposeTests.cs @@ -10,7 +10,7 @@ namespace System.Threading.Tasks.Tests { public static class TaskDisposeTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Dispose_BeforeComplete() { // Verify that a task can only be disposed after it has completed @@ -32,7 +32,7 @@ public static void Dispose_BeforeComplete() task.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Dispose_InContinuation() { // Verify that a task can be disposed by a continuation @@ -50,7 +50,7 @@ public static void Dispose_InContinuation() task2.Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Dispose_ThenAddContinuation() { // Verify that a continuation can be added after a task is completed and disposed 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..090e6e4e260054 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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..ffaa24e9685a65 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.IsMultithreadingSupported))] public static void TaskIDTest() { // Read Parameters @@ -56,7 +56,7 @@ public static void TaskIDTest() } //Use the Start method to start the task - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskOptionsTestAsync() { TaskOptionTest(false); 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 931850512d61a5..0b046a22cdff3e 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.IsMultithreadingSupported))] [OuterLoop] public static void RunRunTests() { @@ -128,7 +128,7 @@ public static void RunRunTests() Assert.True(taskWithResult2.Status == TaskStatus.RanToCompletion, " > FAILED. Task(unwrapped) w/ uncanceled token did not end in RanToCompletion state."); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] public static void RunRunTests_Cancellation_Negative() { @@ -168,7 +168,7 @@ public static void RunRunTests_Cancellation_Negative() Assert.True(taskWithResult3.IsCanceled, " > FAILED. Task(unwrapped) w/ canceled token should have ended in Canceled state"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunRunTests_Unwrap_NegativeCases() { // @@ -580,7 +580,7 @@ public static void TaskDelay_MaxSupported_Success() Assert.True(t.IsCanceled); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunDelayTests() { // @@ -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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunExceptionWrappingTest() { Action throwException = delegate { throw new InvalidOperationException(); }; @@ -850,7 +850,7 @@ public static void RunExceptionWrappingTest() AsyncExceptionChecker(asyncTaskWithResult, "Task-based FromAsync(beginMethod, ...)"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void RunDenyChildAttachTests() { // StartNew, Task and Task 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 657b1de87f740a..bf744367cdb50d 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void TestTaskTConstruction_ct_tco() { for (int i = 0; i < 2; i++) @@ -829,7 +829,7 @@ public static void RunBasicTaskWithResultTest_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.IsMultithreadingSupported))] public static void RunBasicTaskWithResultTest_PromiseTestsAndCancellation() { // @@ -901,7 +901,7 @@ public static void RunBasicTaskWithResultTest_PromiseTestsAndCancellation() } // Test the Task.RunSynchronously() API on external and internal threads - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [OuterLoop] public static void RunTaskWaitAllTests() { @@ -1580,7 +1580,7 @@ private static void DoRunTaskWaitAllTestWithCancellationToken(bool staThread, } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunLongRunningTaskTests() { TaskScheduler tm = TaskScheduler.Default; @@ -1620,7 +1620,7 @@ public static void RunLongRunningTaskTests() // Various tests to exercise the refactored Task class. // Create()==>Factory.StartNew(), Task and Task ctors have been added, // and Task.Start() has been added. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunRefactoringTests() { int temp = 0; @@ -1896,7 +1896,7 @@ public static void RunRefactoringTests() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunRefactoringTests_NegativeTests() { TaskCompletionSource tr = new TaskCompletionSource(); @@ -2015,7 +2015,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.IsMultithreadingSupported))] public static void RunTaskStatusTests() { Task t; @@ -2197,7 +2197,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.IsMultithreadingSupported))] public static void RunTaskStatusTests_NegativeTests() { Task t; @@ -2383,7 +2383,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.IsMultithreadingSupported))] public static void RunTaskWaitTest() { // wait on non-exceptional task @@ -2431,7 +2431,7 @@ public static void RunTaskWaitTest() } // Just runs a task and waits on it. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunTaskWaitTest_NegativeTests() { string exceptionMsg = "myexception"; @@ -2525,7 +2525,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.IsMultithreadingSupported))] public static void RunTaskRecursiveWaitTest() { Task t2 = null; @@ -2568,7 +2568,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.IsMultithreadingSupported))] public static void RunTaskWaitTimeoutTest() { ManualResetEvent mre = new ManualResetEvent(false); @@ -2590,7 +2590,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.IsMultithreadingSupported))] public static void RunTaskRecursiveWaitTimeoutTest() { ManualResetEvent taskStartedMRE = new ManualResetEvent(false); @@ -2674,7 +2674,7 @@ public static void RunTaskRecursiveWaitTimeoutTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunTaskCanceledExceptionTests() { TaskCanceledException tce = null; @@ -2724,7 +2724,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.IsMultithreadingSupported))] 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 913ef2ec0ddc5f..a01ce8501ffad0 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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 f8d8c11f8d5f18..55ac578bc63855 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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 6a3b1d5223bf54..5f8272b0bc81d6 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 @@ -188,7 +188,7 @@ public static void ThrowException() #endregion } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class TaskWaitAllAnyTest { #region Private Fields @@ -448,7 +448,7 @@ private bool CheckResult(double result) #endregion - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public sealed class TaskWaitAllAny { [Fact] 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..f788fdc297a4ab 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.IsMultithreadingSupported))] public static void RunTaskFactoryTests() { TaskScheduler tm = TaskScheduler.Default; @@ -68,7 +68,7 @@ public static void RunTaskFactoryTests() } // Exercise functionality of TaskFactory and TaskFactory - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunTaskFactoryTests_Cancellation_Negative() { CancellationTokenSource cancellationSrc = new CancellationTokenSource(); 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 7f2d569f201a6d..14eb7d1da70e77 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.IsMultithreadingSupported))] 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 7af868d9081e65..76fcf529f8efe8 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.IsMultithreadingSupported))] public static void RunBuggySchedulerTests() { Debug.WriteLine("* RunBuggySchedulerTests()"); diff --git a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskToAsyncResultTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskToAsyncResultTests.cs index d0ee2a62034383..e293ad8807d3f3 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskToAsyncResultTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Tasks.Tests/TaskToAsyncResultTests.cs @@ -127,7 +127,7 @@ public void EndFromTask_PropagatesExceptions() Assert.Throws(() => TaskToAsyncResult.End(ar)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task WithFromAsync_IAsyncResult_Roundtrips() { var tcs = new TaskCompletionSource(); 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..a79db9be2b68fe 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 @@ -383,7 +383,7 @@ public void Generic_UnsuccessfulOuter(bool outerCompletesBeforeUnwrap, TaskStatu /// /// Test Unwrap when the outer task for a non-generic inner task is marked as AttachedToParent. /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void NonGeneric_AttachedToParent() { Exception error = new InvalidTimeZoneException(); @@ -408,7 +408,7 @@ public void NonGeneric_AttachedToParent() /// /// Test Unwrap when the outer task for a generic inner task is marked as AttachedToParent. /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Generic_AttachedToParent() { Exception error = new InvalidTimeZoneException(); @@ -433,7 +433,7 @@ public void Generic_AttachedToParent() /// /// Test that Unwrap with a non-generic task doesn't use TaskScheduler.Current. /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void NonGeneric_DefaultSchedulerUsed() { var scheduler = new CountingScheduler(); @@ -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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public void RunStackGuardTests() { const int DiveDepth = 12000; diff --git a/src/libraries/System.Runtime/tests/System.Threading.Timer.Tests/TimerChangeTests.cs b/src/libraries/System.Runtime/tests/System.Threading.Timer.Tests/TimerChangeTests.cs index fdd62265a1680d..607c5fd500bdc7 100644 --- a/src/libraries/System.Runtime/tests/System.Threading.Timer.Tests/TimerChangeTests.cs +++ b/src/libraries/System.Runtime/tests/System.Threading.Timer.Tests/TimerChangeTests.cs @@ -49,7 +49,7 @@ public void Timer_Change_AfterDispose_Test() Assert.False(t.Change(TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1))); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(2)] 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..e390601ed1ea61 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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..a235b932f6dca5 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] // values chosen based on knowing the 333 pivot used in implementation [InlineData(1, 1)] [InlineData(50, 50)] [InlineData(250, 50)] @@ -121,7 +121,7 @@ public void Timer_ChangeToDelete_DoesntFire() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public void Timer_Dispose_WaitHandle() { int tickCount = 0; @@ -361,7 +361,7 @@ orderby groupedByDueTime.Key } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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..4f409242f2fd93 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.IsMultithreadingSupported))] public static void ConcurrentAccess() { const int ParallelTasks = 3; diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonDocumentTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonDocumentTests.cs index 07d629c6f49278..7cbfb5b0cf35d2 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonDocumentTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/JsonDocumentTests.cs @@ -3696,7 +3696,7 @@ public static void NameEquals_Empty_Throws() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] // thread-safety / stress test public static async Task GetString_ConcurrentUse_ThreadSafe() { diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/EnumConverterTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/EnumConverterTests.cs index fa5bc9ae5f24c0..df167c9376e220 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/EnumConverterTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/EnumConverterTests.cs @@ -383,7 +383,7 @@ public static void MoreThan64EnumValuesToSerializeWithNamingPolicy(bool useGener } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] public static void VeryLargeAmountOfEnumsToSerialize() { diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/JsonElementTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/JsonElementTests.cs index 19d8487caa6ad0..f8b20c354ac8d6 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/JsonElementTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/JsonElementTests.cs @@ -235,7 +235,7 @@ public static void DeepEquals_DeepJsonDocument(int depth) } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotMonoInterpreter))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported), nameof(PlatformDetection.IsNotMonoInterpreter))] public static async Task DeepEquals_TooDeepJsonDocument_ThrowsInsufficientExecutionStackException() { var tcs = new TaskCompletionSource(); diff --git a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.Match.Tests.cs b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.Match.Tests.cs index 2ec270557c3c69..c03f22a893ac1a 100644 --- a/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.Match.Tests.cs +++ b/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/Regex.Match.Tests.cs @@ -2956,7 +2956,7 @@ public static IEnumerable UseRegexConcurrently_ThreadSafe_Success_Memb } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop("Takes several seconds")] [MemberData(nameof(UseRegexConcurrently_ThreadSafe_Success_MemberData))] public async Task UseRegexConcurrently_ThreadSafe_Success(RegexEngine engine, TimeSpan timeout) diff --git a/src/libraries/System.Threading.Channels/tests/BoundedChannelTests.cs b/src/libraries/System.Threading.Channels/tests/BoundedChannelTests.cs index d3f994686859ef..c23dce73dbdd0d 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [InlineData(1)] [InlineData(10)] [InlineData(10000)] @@ -612,7 +612,7 @@ public async Task WaitToWriteAsync_AfterFullThenRead_ReturnsTrue() Assert.True(await write2); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(ThreeBools))] public void AllowSynchronousContinuations_Reading_ContinuationsInvokedAccordingToSetting(bool allowSynchronousContinuations, bool cancelable, bool waitToReadAsync) { @@ -637,9 +637,9 @@ public void AllowSynchronousContinuations_Reading_ContinuationsInvokedAccordingT [InlineData(true)] public void AllowSynchronousContinuations_CompletionTask_ContinuationsInvokedAccordingToSetting(bool allowSynchronousContinuations) { - if (!allowSynchronousContinuations && !PlatformDetection.IsThreadingSupported) + if (!allowSynchronousContinuations && !PlatformDetection.IsMultithreadingSupported) { - throw new SkipTestException(nameof(PlatformDetection.IsThreadingSupported)); + throw new SkipTestException(nameof(PlatformDetection.IsMultithreadingSupported)); } var c = Channel.CreateBounded(new BoundedChannelOptions(1) { AllowSynchronousContinuations = allowSynchronousContinuations }); diff --git a/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs b/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs index 2799d6509d1a70..47c99ad11d8437 100644 --- a/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs +++ b/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs @@ -142,7 +142,7 @@ public void Count_ThrowsIfUnsupported() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/60472", TestPlatforms.iOS | TestPlatforms.tvOS)] public void SingleProducerConsumer_ConcurrentReadWrite_Success() { @@ -166,7 +166,7 @@ public void SingleProducerConsumer_ConcurrentReadWrite_Success() })); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/60472", TestPlatforms.iOS | TestPlatforms.tvOS)] public void SingleProducerConsumer_PingPong_Success() { @@ -193,7 +193,7 @@ public void SingleProducerConsumer_PingPong_Success() })); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(1, 1)] [InlineData(1, 10)] [InlineData(10, 1)] diff --git a/src/libraries/System.Threading.Channels/tests/ChannelTests.cs b/src/libraries/System.Threading.Channels/tests/ChannelTests.cs index f42096f7890dae..897199c79244e7 100644 --- a/src/libraries/System.Threading.Channels/tests/ChannelTests.cs +++ b/src/libraries/System.Threading.Channels/tests/ChannelTests.cs @@ -87,7 +87,7 @@ public void BoundedChannelOptions_InvalidCapacity_ThrowArgumentExceptions(int ca public void CreateBounded_ValidBufferSizes_Success(int bufferedCapacity) => Assert.NotNull(Channel.CreateBounded(bufferedCapacity)); - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task DefaultWriteAsync_UsesWaitToWriteAsyncAndTryWrite() { var c = new TestChannelWriter(10); diff --git a/src/libraries/System.Threading.Channels/tests/RendezvousChannelTests.cs b/src/libraries/System.Threading.Channels/tests/RendezvousChannelTests.cs index 5de9153ca120a6..9b7aeec3243d96 100644 --- a/src/libraries/System.Threading.Channels/tests/RendezvousChannelTests.cs +++ b/src/libraries/System.Threading.Channels/tests/RendezvousChannelTests.cs @@ -147,7 +147,7 @@ public void DroppedDelegateIsNull_SyncAndAsyncWrites(BoundedChannelFullMode boun Assert.Equal(0, item); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(BoundedChannelFullMode.DropWrite)] [InlineData(BoundedChannelFullMode.DropOldest)] [InlineData(BoundedChannelFullMode.DropNewest)] @@ -186,7 +186,7 @@ public void DroppedDelegateCalledAfterLockReleased_SyncWrites(BoundedChannelFull Assert.True(dropDelegateCalled); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(BoundedChannelFullMode.DropWrite)] [InlineData(BoundedChannelFullMode.DropOldest)] [InlineData(BoundedChannelFullMode.DropNewest)] @@ -266,7 +266,7 @@ public async Task WaitToWriteAsync_AfterRead_ReturnsTrue() Assert.True(await write3); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(ThreeBools))] public void AllowSynchronousContinuations_Reading_ContinuationsInvokedAccordingToSetting(bool allowSynchronousContinuations, bool cancelable, bool waitToReadAsync) { @@ -296,9 +296,9 @@ public void AllowSynchronousContinuations_Reading_ContinuationsInvokedAccordingT [InlineData(true)] public void AllowSynchronousContinuations_CompletionTask_ContinuationsInvokedAccordingToSetting(bool allowSynchronousContinuations) { - if (!allowSynchronousContinuations && !PlatformDetection.IsThreadingSupported) + if (!allowSynchronousContinuations && !PlatformDetection.IsMultithreadingSupported) { - throw new SkipTestException(nameof(PlatformDetection.IsThreadingSupported)); + throw new SkipTestException(nameof(PlatformDetection.IsMultithreadingSupported)); } var c = Channel.CreateBounded(new BoundedChannelOptions(0) { AllowSynchronousContinuations = allowSynchronousContinuations }); diff --git a/src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs b/src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs index 4a25da42ce80e5..3ca8cc5741e886 100644 --- a/src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs +++ b/src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs @@ -136,7 +136,7 @@ public async Task WriteMany_ThenComplete_SuccessfullyReadAll(int readMode) await c.Reader.Completion; } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AllowSynchronousContinuations_WaitToReadAsync_ContinuationsInvokedAccordingToSetting() { Channel c = CreateChannel(); @@ -152,7 +152,7 @@ public void AllowSynchronousContinuations_WaitToReadAsync_ContinuationsInvokedAc r.GetAwaiter().GetResult(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void AllowSynchronousContinuations_CompletionTask_ContinuationsInvokedAccordingToSetting() { Channel c = CreateChannel(); @@ -169,7 +169,7 @@ public void AllowSynchronousContinuations_CompletionTask_ContinuationsInvokedAcc } [OuterLoop] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Completion_CompletesAfterConcurrentTryReadAndTryComplete() { for (int iter = 0; iter < 100_000; iter++) @@ -242,7 +242,7 @@ public async Task MultipleReaders_CancelsPreviousReader() Assert.Equal(42, await t2); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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..247aba08e8f553 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.IsMultithreadingSupported))] public async Task Create_BlockingFactoryDoesNotBlockOtherPartitions() { var limiterFactory = new TrackingRateLimiterFactory(); 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..004985d0e127e1 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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..25cb6f9079e155 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.IsMultithreadingSupported))] 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..1f8ed5777074f3 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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..eb41f121e76a1e 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public void TestEncapsulate_LinkingAndUnlinking() { var buffer = new BufferBlock(); diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/DebugAttributeTests.cs b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/DebugAttributeTests.cs index 75f45c48a260ad..b9ff781dd031a9 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/DebugAttributeTests.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/Dataflow/DebugAttributeTests.cs @@ -8,7 +8,7 @@ namespace System.Threading.Tasks.Dataflow.Tests { public class DebugAttributeTests { - public static bool IsThreadingAndDebuggerAttributesSupported => PlatformDetection.IsThreadingSupported && PlatformDetection.IsDebuggerTypeProxyAttributeSupported; + public static bool IsThreadingAndDebuggerAttributesSupported => PlatformDetection.IsMultithreadingSupported && PlatformDetection.IsDebuggerTypeProxyAttributeSupported; [ConditionalFact(nameof(IsThreadingAndDebuggerAttributesSupported))] public void TestDebuggerDisplaysAndTypeProxies() 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..069abcee3c745c 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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..73205b6057341f 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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..53e4bf816a4d40 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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 da3114ad204984..14602b41127e35 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.IsMultithreadingSupported))] public async Task TestReceiveThenPost() { var wob = new WriteOnceBlock(null); @@ -188,7 +188,7 @@ public async Task TestReceiveThenPost() Assert.Equal(expected: 16, actual: await t); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] // stress test with many iterations public async Task TestConcurrentPostAndReceiveAsync() { diff --git a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.cs b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.cs index 349b926a0286a2..207bc34018fc8e 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.cs @@ -13,6 +13,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Numerics; +using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Runtime.Versioning; @@ -130,15 +131,6 @@ internal int EffectiveMaxConcurrencyLevel /// public static partial class Parallel { - - [SupportedOSPlatformGuard("browser")] - [SupportedOSPlatformGuard("wasi")] -#if FEATURE_SINGLE_THREADED - internal static bool IsSingleThreaded => true; -#else - internal static bool IsSingleThreaded => false; -#endif - // static counter for generating unique Fork/Join Context IDs to be used in ETW events internal static int s_forkJoinContextID; @@ -248,7 +240,7 @@ public static void Invoke(ParallelOptions parallelOptions, params Action[] actio { // If we've gotten this far, it's time to process the actions. - if (IsSingleThreaded || + if (!RuntimeFeature.IsMultithreadingSupported || // This is more efficient for a large number of actions, or for enforcing MaxDegreeOfParallelism: (actionsCopy.Length > SMALL_ACTIONCOUNT_LIMIT) || (parallelOptions.MaxDegreeOfParallelism != -1 && parallelOptions.MaxDegreeOfParallelism < actionsCopy.Length) diff --git a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs index 8ac39f0c832933..75b5d2dcdb5ed8 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Concurrent; +using System.Runtime.CompilerServices; namespace System.Threading.Tasks { @@ -131,7 +132,7 @@ public static void Run(ReplicatableUserAction action, ParallelOp { // Browser hosts do not support synchronous Wait so we want to run the // replicated task directly instead of going through Task infrastructure - if (Parallel.IsSingleThreaded) + if (!RuntimeFeature.IsMultithreadingSupported) { // Since we are running on a single thread, we don't want the action to time out long timeout = long.MaxValue - 1; diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs index 093d35bb55e0e9..07a2774520dd88 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs @@ -13,7 +13,7 @@ namespace System.Threading.Tasks.Tests { public sealed class ParallelForEachAsyncTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void InvalidArguments_ThrowsException() { AssertExtensions.Throws("source", () => { Parallel.ForEachAsync((IEnumerable)null, (item, cancellationToken) => default); }); @@ -41,7 +41,7 @@ public void InvalidArguments_ThrowsException() AssertExtensions.Throws("body", () => { Parallel.ForEachAsync(EnumerableRangeAsync(1, 10), new ParallelOptions(), null); }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void PreCanceled_CancelsSynchronously() { var box = new StrongBox(false); @@ -87,7 +87,7 @@ static async IAsyncEnumerable MarkStartAsync(StrongBox box) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(-1)] [InlineData(1)] [InlineData(2)] @@ -120,7 +120,7 @@ public async Task Dop_WorkersCreatedRespectingLimit_For(int dop) Assert.InRange(activeWorkers, 0, dop == -1 ? Environment.ProcessorCount : dop); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(-1)] [InlineData(1)] [InlineData(2)] @@ -158,7 +158,7 @@ static IEnumerable IterateUntilSet(StrongBox box) Assert.InRange(activeWorkers, 0, dop == -1 ? Environment.ProcessorCount : dop); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(-1)] [InlineData(1)] [InlineData(2)] @@ -192,7 +192,7 @@ public async Task Dop_WorkersCreatedRespectingLimitAndTaskScheduler_For(int dop) Assert.InRange(activeWorkers, 0, Math.Min(MaxSchedulerLimit, dop == -1 ? Environment.ProcessorCount : dop)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(-1)] [InlineData(1)] [InlineData(2)] @@ -232,7 +232,7 @@ static IEnumerable IterateUntilSet(StrongBox box) Assert.InRange(activeWorkers, 0, Math.Min(MaxSchedulerLimit, dop == -1 ? Environment.ProcessorCount : dop)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Dop_NegativeTaskSchedulerLimitTreatedAsDefault_For() { bool exit = false; @@ -259,7 +259,7 @@ public async Task Dop_NegativeTaskSchedulerLimitTreatedAsDefault_For() Assert.InRange(activeWorkers, 0, Environment.ProcessorCount); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Dop_NegativeTaskSchedulerLimitTreatedAsDefault_Sync() { static IEnumerable IterateUntilSet(StrongBox box) @@ -292,7 +292,7 @@ static IEnumerable IterateUntilSet(StrongBox box) Assert.InRange(activeWorkers, 0, Environment.ProcessorCount); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Dop_NegativeTaskSchedulerLimitTreatedAsDefault_Async() { static async IAsyncEnumerable IterateUntilSet(StrongBox box) @@ -326,7 +326,7 @@ static async IAsyncEnumerable IterateUntilSet(StrongBox box) Assert.InRange(activeWorkers, 0, Environment.ProcessorCount); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task RunsAsynchronously_For() { var cts = new CancellationTokenSource(); @@ -339,7 +339,7 @@ public async Task RunsAsynchronously_For() await Assert.ThrowsAnyAsync(() => t); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task RunsAsynchronously_EvenForEntirelySynchronousWork_Sync() { static IEnumerable Iterate() @@ -357,7 +357,7 @@ static IEnumerable Iterate() await Assert.ThrowsAnyAsync(() => t); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task RunsAsynchronously_EvenForEntirelySynchronousWork_Async() { #pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously @@ -377,7 +377,7 @@ static async IAsyncEnumerable IterateAsync() await Assert.ThrowsAnyAsync(() => t); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(-1)] [InlineData(1)] [InlineData(2)] @@ -416,7 +416,7 @@ static async IAsyncEnumerable IterateUntilSetAsync(StrongBox box) Assert.InRange(activeWorkers, 0, dop == -1 ? Environment.ProcessorCount : dop); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void EmptyRange_For() { int counter = 0; @@ -430,7 +430,7 @@ public void EmptyRange_For() Assert.Equal(0, counter); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task EmptySource_Sync() { int counter = 0; @@ -443,7 +443,7 @@ await Parallel.ForEachAsync(Enumerable.Range(0, 0), (item, cancellationToken) => Assert.Equal(0, counter); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task EmptySource_Async() { int counter = 0; @@ -456,7 +456,7 @@ await Parallel.ForEachAsync(EnumerableRangeAsync(0, 0), (item, cancellationToken Assert.Equal(0, counter); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task AllItemsEnumeratedOnce_For(bool yield) @@ -501,7 +501,7 @@ await Parallel.ForAsync(T.CreateTruncating(Start), T.CreateTruncating(Start + Co } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task AllItemsEnumeratedOnce_Sync(bool yield) @@ -531,7 +531,7 @@ await Parallel.ForEachAsync(Enumerable.Range(Start, Count), async (item, cancell Assert.False(set.Contains(Start + Count + 1)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task AllItemsEnumeratedOnce_Async(bool yield) @@ -561,7 +561,7 @@ await Parallel.ForEachAsync(EnumerableRangeAsync(Start, Count, yield), async (it Assert.False(set.Contains(Start + Count + 1)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_For(bool defaultScheduler) @@ -589,7 +589,7 @@ public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_For(bool defau Assert.Equal(Enumerable.Range(1, 100), cq.OrderBy(i => i)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_Sync(bool defaultScheduler) @@ -627,7 +627,7 @@ IEnumerable Iterate() Assert.Equal(Enumerable.Range(1, 100), cq.OrderBy(i => i)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_Async(bool defaultScheduler) @@ -666,7 +666,7 @@ async IAsyncEnumerable Iterate() Assert.Equal(Enumerable.Range(1, 100), cq.OrderBy(i => i)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Cancellation_CancelsIterationAndReturnsCanceledTask_For() { using var cts = new CancellationTokenSource(10); @@ -677,7 +677,7 @@ public async Task Cancellation_CancelsIterationAndReturnsCanceledTask_For() Assert.Equal(cts.Token, oce.CancellationToken); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Cancellation_CancelsIterationAndReturnsCanceledTask_Sync() { static async IAsyncEnumerable Infinite() @@ -698,7 +698,7 @@ static async IAsyncEnumerable Infinite() Assert.Equal(cts.Token, oce.CancellationToken); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Cancellation_CancelsIterationAndReturnsCanceledTask_Async() { static async IAsyncEnumerable InfiniteAsync() @@ -719,7 +719,7 @@ static async IAsyncEnumerable InfiniteAsync() Assert.Equal(cts.Token, oce.CancellationToken); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Cancellation_CorrectTokenPassedToAsyncEnumerator() { static async IAsyncEnumerable YieldTokenAsync([EnumeratorCancellation] CancellationToken cancellationToken) @@ -735,7 +735,7 @@ await Parallel.ForEachAsync(YieldTokenAsync(default), (item, cancellationToken) }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Cancellation_SameTokenPassedToEveryInvocation_For() { var cq = new ConcurrentQueue(); @@ -750,7 +750,7 @@ await Parallel.ForAsync(1, 101, async (item, cancellationToken) => Assert.Equal(1, cq.Distinct().Count()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Cancellation_SameTokenPassedToEveryInvocation_Sync() { var cq = new ConcurrentQueue(); @@ -765,7 +765,7 @@ await Parallel.ForEachAsync(Enumerable.Range(1, 100), async (item, cancellationT Assert.Equal(1, cq.Distinct().Count()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Cancellation_SameTokenPassedToEveryInvocation_Async() { var cq = new ConcurrentQueue(); @@ -780,7 +780,7 @@ await Parallel.ForEachAsync(EnumerableRangeAsync(1, 100), async (item, cancellat Assert.Equal(1, cq.Distinct().Count()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Cancellation_HasPriorityOverExceptions_For() { var tcs = new TaskCompletionSource(); @@ -806,7 +806,7 @@ public async Task Cancellation_HasPriorityOverExceptions_For() Assert.True(t.IsCanceled); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Cancellation_HasPriorityOverExceptions_Sync() { static IEnumerable Iterate() @@ -838,7 +838,7 @@ static IEnumerable Iterate() Assert.True(t.IsCanceled); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Cancellation_HasPriorityOverExceptions_Async() { static async IAsyncEnumerable Iterate() @@ -874,7 +874,7 @@ static async IAsyncEnumerable Iterate() Assert.True(t.IsCanceled); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task Cancellation_FaultsForOceForNonCancellation_For(bool internalToken) @@ -890,7 +890,7 @@ public async Task Cancellation_FaultsForOceForNonCancellation_For(bool internalT Assert.True(t.IsFaulted); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task Cancellation_FaultsForOceForNonCancellation(bool internalToken) @@ -916,7 +916,7 @@ static async IAsyncEnumerable Iterate() Assert.True(t.IsFaulted); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0, 4)] [InlineData(1, 4)] [InlineData(2, 4)] @@ -948,7 +948,7 @@ public async Task Cancellation_InternalCancellationExceptionsArentFilteredOut_Fo Assert.Equal(numThrowingNonCanceledOce, t.Exception.InnerExceptions.Count(e => e is OperationCanceledException)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0, 4)] [InlineData(1, 4)] [InlineData(2, 4)] @@ -980,7 +980,7 @@ public async Task Cancellation_InternalCancellationExceptionsArentFilteredOut(in Assert.Equal(numThrowingNonCanceledOce, t.Exception.InnerExceptions.Count(e => e is OperationCanceledException)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Exception_FromGetEnumerator_Sync() { Task t = Parallel.ForEachAsync((IEnumerable)new ThrowsFromGetEnumerator(), (item, cancellationToken) => default); @@ -989,7 +989,7 @@ public void Exception_FromGetEnumerator_Sync() Assert.IsType(t.Exception.InnerException); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Exception_FromGetEnumerator_Async() { Task t = Parallel.ForEachAsync((IAsyncEnumerable)new ThrowsFromGetEnumerator(), (item, cancellationToken) => default); @@ -998,7 +998,7 @@ public void Exception_FromGetEnumerator_Async() Assert.IsType(t.Exception.InnerException); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Exception_NullFromGetEnumerator_Sync() { Task t = Parallel.ForEachAsync((IEnumerable)new ReturnsNullFromGetEnumerator(), (item, cancellationToken) => default); @@ -1007,7 +1007,7 @@ public void Exception_NullFromGetEnumerator_Sync() Assert.IsType(t.Exception.InnerException); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Exception_NullFromGetEnumerator_Async() { Task t = Parallel.ForEachAsync((IAsyncEnumerable)new ReturnsNullFromGetEnumerator(), (item, cancellationToken) => default); @@ -1016,7 +1016,7 @@ public void Exception_NullFromGetEnumerator_Async() Assert.IsType(t.Exception.InnerException); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Exception_FromMoveNext_Sync() { static IEnumerable Iterate() @@ -1036,7 +1036,7 @@ static IEnumerable Iterate() Assert.True(t.IsFaulted); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Exception_FromMoveNext_Async() { static async IAsyncEnumerable Iterate() @@ -1057,7 +1057,7 @@ static async IAsyncEnumerable Iterate() Assert.True(t.IsFaulted); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Exception_FromLoopBody_For() { var barrier = new Barrier(2); @@ -1078,7 +1078,7 @@ public async Task Exception_FromLoopBody_For() Assert.Contains(t.Exception.InnerExceptions, e => e is InvalidTimeZoneException); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Exception_FromLoopBody_Sync() { static IEnumerable Iterate() @@ -1105,7 +1105,7 @@ static IEnumerable Iterate() Assert.Contains(t.Exception.InnerExceptions, e => e is InvalidTimeZoneException); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Exception_FromLoopBody_Async() { static async IAsyncEnumerable Iterate() @@ -1146,7 +1146,7 @@ static async IAsyncEnumerable Iterate() Assert.Contains(t.Exception.InnerExceptions, e => e is DivideByZeroException); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Exception_FromDispose_Sync() { Task t = Parallel.ForEachAsync((IEnumerable)new ThrowsExceptionFromDispose(), (item, cancellationToken) => default); @@ -1154,7 +1154,7 @@ public async Task Exception_FromDispose_Sync() Assert.True(t.IsFaulted); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Exception_FromDispose_Async() { Task t = Parallel.ForEachAsync((IAsyncEnumerable)new ThrowsExceptionFromDispose(), (item, cancellationToken) => default); @@ -1162,7 +1162,7 @@ public async Task Exception_FromDispose_Async() Assert.True(t.IsFaulted); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Exception_FromDisposeAndCancellationCallback_Sync() { Task t = Parallel.ForEachAsync((IEnumerable)new ThrowsExceptionFromDisposeAndCancellationCallback(), (item, cancellationToken) => default); @@ -1171,7 +1171,7 @@ public async Task Exception_FromDisposeAndCancellationCallback_Sync() Assert.DoesNotContain(t.Exception.InnerExceptions, e => e is InvalidTimeZoneException); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Exception_FromDisposeAndCancellationCallback_Async() { Task t = Parallel.ForEachAsync((IAsyncEnumerable)new ThrowsExceptionFromDisposeAndCancellationCallback(), (item, cancellationToken) => default); @@ -1180,7 +1180,7 @@ public async Task Exception_FromDisposeAndCancellationCallback_Async() Assert.Contains(t.Exception.InnerExceptions, e => e is InvalidTimeZoneException); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Exception_ImplicitlyCancelsOtherWorkers_For() { await Assert.ThrowsAsync(() => Parallel.ForAsync(0, long.MaxValue, async (item, cancellationToken) => @@ -1208,7 +1208,7 @@ await Assert.ThrowsAsync(() => Parallel.ForAsync(0, long.MaxValue, as })); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Exception_ImplicitlyCancelsOtherWorkers_Sync() { static IEnumerable Iterate() @@ -1245,7 +1245,7 @@ await Assert.ThrowsAsync(() => Parallel.ForEachAsync(Iterate(), async })); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task Exception_ImplicitlyCancelsOtherWorkers_Async() { static async IAsyncEnumerable Iterate() @@ -1283,7 +1283,7 @@ await Assert.ThrowsAsync(() => Parallel.ForEachAsync(Iterate(), async })); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void Exception_LockWaitAsyncCancellationDoesntPropagate() { static async IAsyncEnumerable Iterate(Task signal) @@ -1313,7 +1313,7 @@ static async IAsyncEnumerable Iterate(Task signal) Assert.IsType(ae.InnerException); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task ExecutionContext_FlowsToWorkerBodies_For(bool defaultScheduler) @@ -1331,7 +1331,7 @@ await Parallel.ForAsync(0, 100, async (item, cancellationToken) => }); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task ExecutionContext_FlowsToWorkerBodies_Sync(bool defaultScheduler) @@ -1357,7 +1357,7 @@ await Parallel.ForEachAsync(Iterate(), async (item, cancellationToken) => }); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false, false)] [InlineData(false, true)] [InlineData(true, false)] @@ -1393,7 +1393,7 @@ static async IAsyncEnumerable Iterate() await t; } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task GitHubIssue_114262_Async() { var options = new ParallelOptions diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs index 399ba8c63f5e27..288def7bde9f73 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void TestInvokeDOPAndCancel() { ParallelOptions parallelOptions = null; @@ -1210,7 +1210,7 @@ public static void RunParallelLoopCancellationTests() /// /// Test to ensure that the task ID can be accessed from inside the task /// - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TaskIDFromExternalContextTest() { int? withinTaskId = int.MinValue; @@ -1241,7 +1241,7 @@ private static void VerifyCancelTestState( } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CancelForIntTest() { for (int i = 0; i < 100; ++i) @@ -1275,7 +1275,7 @@ public static void CancelForIntTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CancelForLongTest() { for (int i = 0; i < 100; ++i) @@ -1316,7 +1316,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.IsMultithreadingSupported))] [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..d6801ec1f6cdd8 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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..6ddcafd05ece54 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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..f70465af2ddd88 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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 f6835859ebe6dd..f13be0cb2e1730 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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..f7e3ecf6801445 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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..b902288e0e9bbc 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.IsMultithreadingSupported))] public static void RespectParentCancellation1() { RespectParentCancellationTest test = new RespectParentCancellationTest(API.For); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RespectParentCancellation2() { RespectParentCancellationTest test = new RespectParentCancellationTest(API.For64); test.RealRun(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RespectParentCancellation3() { RespectParentCancellationTest test = new RespectParentCancellationTest(API.Foreach); diff --git a/src/libraries/System.Threading.Thread/tests/ThreadTests.cs b/src/libraries/System.Threading.Thread/tests/ThreadTests.cs index 15390f0dbed35e..0af63973dc686f 100644 --- a/src/libraries/System.Threading.Thread/tests/ThreadTests.cs +++ b/src/libraries/System.Threading.Thread/tests/ThreadTests.cs @@ -26,7 +26,7 @@ public static class ThreadTests private const int UnexpectedTimeoutMilliseconds = ThreadTestHelpers.UnexpectedTimeoutMilliseconds; private const int ExpectedTimeoutMilliseconds = ThreadTestHelpers.ExpectedTimeoutMilliseconds; - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void ConstructorTest() { const int SmallStackSizeBytes = 128 << 10; // 128 KB @@ -339,7 +339,7 @@ public static void ApartmentStateTest_Unix( Assert.Equal(expectedFailure, setApartmentState(t, ApartmentState.MTA)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CurrentCultureTest_DifferentThread() { CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone(); @@ -380,7 +380,7 @@ public static void CurrentCultureTest_DifferentThread() exceptionFromThread?.Throw(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CurrentCultureTest() { ThreadTestHelpers.RunTestInBackgroundThread(() => @@ -422,13 +422,13 @@ public static void CurrentCultureTest() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CurrentPrincipalTest_SkipOnDesktopFramework() { ThreadTestHelpers.RunTestInBackgroundThread(() => Assert.Null(Thread.CurrentPrincipal)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CurrentPrincipalTest() { ThreadTestHelpers.RunTestInBackgroundThread(() => @@ -445,7 +445,7 @@ public static void CurrentPrincipalTest() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CurrentPrincipalContextFlowTest() { ThreadTestHelpers.RunTestInBackgroundThread(async () => @@ -478,7 +478,7 @@ await Task.Run(() => }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CurrentPrincipalContextFlowTest_NotFlow() { ThreadTestHelpers.RunTestInBackgroundThread(async () => @@ -528,7 +528,7 @@ public static void CurrentPrincipal_SetNull() }).Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CurrentThreadTest() { Thread otherThread = null; @@ -544,14 +544,14 @@ public static void CurrentThreadTest() Assert.NotEqual(mainThread, otherThread); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void ExecutionContextTest() { ThreadTestHelpers.RunTestInBackgroundThread( () => Assert.Equal(ExecutionContext.Capture(), Thread.CurrentThread.ExecutionContext)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void IsAliveTest() { var isAliveWhenRunning = false; @@ -566,7 +566,7 @@ public static void IsAliveTest() Assert.False(t.IsAlive); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void IsBackgroundTest() { var t = new Thread(() => { }); @@ -587,7 +587,7 @@ public static void IsBackgroundTest() t.Start(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void IsThreadPoolThreadTest() { var isThreadPoolThread = false; @@ -611,7 +611,7 @@ public static void IsThreadPoolThreadTest() Assert.True(isThreadPoolThread); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void ManagedThreadIdTest() { var e = new ManualResetEvent(false); @@ -624,7 +624,7 @@ public static void ManagedThreadIdTest() waitForThread(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void NameTest() { string name = Guid.NewGuid().ToString("N"); @@ -682,7 +682,7 @@ public static void ThreadNameDoesNotAffectProcessName() } [ActiveIssue("https://github.com/dotnet/runtime/issues/72246", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void PriorityTest() { var e = new ManualResetEvent(false); @@ -700,7 +700,7 @@ public static void PriorityTest() waitForThread(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void ThreadStateTest() { var e0 = new ManualResetEvent(false); @@ -737,7 +737,7 @@ public static void ThreadStateTest() Assert.Equal(ThreadState.Stopped, t.ThreadState); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void AbortSuspendTest() { var e = new ManualResetEvent(false); @@ -856,7 +856,7 @@ private static void VerifyLocalDataSlot(LocalDataStoreSlot slot) } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void LocalDataSlotTest() { var slot = Thread.AllocateDataSlot(); @@ -926,7 +926,7 @@ public static void LocalDataSlotTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/49521", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public static void InterruptTest() { @@ -976,7 +976,7 @@ public static void InterruptTest() waitForThread(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/49521", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public static void InterruptInFinallyBlockTest_SkipOnDesktopFramework() { @@ -1002,7 +1002,7 @@ public static void InterruptInFinallyBlockTest_SkipOnDesktopFramework() waitForThread(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void JoinTest() { var threadReady = new ManualResetEvent(false); @@ -1051,7 +1051,7 @@ public static void SleepTest() Assert.InRange((int)stopwatch.ElapsedMilliseconds, 100, int.MaxValue); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public static void StartTest(bool useUnsafeStart) diff --git a/src/libraries/System.Threading.ThreadPool/tests/RegisteredWaitTests.cs b/src/libraries/System.Threading.ThreadPool/tests/RegisteredWaitTests.cs index 4dfcdf20edcef1..0229e72bcb600f 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void MultipleRegisteredWaitsUnregisterHandleShiftTest() { var handlePendingRemoval = new AutoResetEvent(false); diff --git a/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs b/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs index a59997f8e3f8b3..8fc2bb09f6a144 100644 --- a/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs +++ b/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs @@ -74,7 +74,7 @@ private static void ConcurrentInitializeTest() }, UsePortableThreadPool.ToString()).Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void GetMinMaxThreadsTest() { int minw, minc; @@ -88,7 +88,7 @@ public static void GetMinMaxThreadsTest() Assert.True(minc <= maxc); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void GetAvailableThreadsTest() { int w, c; @@ -267,7 +267,7 @@ public static void SetMinThreadsTo0Test() }).Dispose(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(TwoBools))] public void QueueUserWorkItem_PreferLocal_InvalidArguments_Throws(bool preferLocal, bool useUnsafe) { @@ -276,7 +276,7 @@ public void QueueUserWorkItem_PreferLocal_InvalidArguments_Throws(bool preferLoc ThreadPool.QueueUserWorkItem(null, new object(), preferLocal)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(TwoBools))] public async Task QueueUserWorkItem_PreferLocal_NullValidForState(bool preferLocal, bool useUnsafe) { @@ -292,7 +292,7 @@ public async Task QueueUserWorkItem_PreferLocal_NullValidForState(bool preferLoc Assert.Equal(84, await tcs.Task); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(TwoBools))] public async Task QueueUserWorkItem_PreferLocal_ReferenceTypeStateObjectPassedThrough(bool preferLocal, bool useUnsafe) { @@ -308,7 +308,7 @@ public async Task QueueUserWorkItem_PreferLocal_ReferenceTypeStateObjectPassedTh Assert.Equal(84, await tcs.Task); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(TwoBools))] public async Task QueueUserWorkItem_PreferLocal_ValueTypeStateObjectPassedThrough(bool preferLocal, bool useUnsafe) { @@ -324,7 +324,7 @@ public async Task QueueUserWorkItem_PreferLocal_ValueTypeStateObjectPassedThroug Assert.Equal(42, await tcs.Task); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(TwoBools))] public async Task QueueUserWorkItem_PreferLocal_RunsAsynchronously(bool preferLocal, bool useUnsafe) { @@ -344,7 +344,7 @@ await Task.Factory.StartNew(() => }, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(TwoBools))] public async Task QueueUserWorkItem_PreferLocal_ExecutionContextFlowedIfSafe(bool preferLocal, bool useUnsafe) { @@ -362,7 +362,7 @@ public async Task QueueUserWorkItem_PreferLocal_ExecutionContextFlowedIfSafe(boo Assert.Equal(useUnsafe ? 0 : 42, await tcs.Task); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(OneBool))] public void UnsafeQueueUserWorkItem_IThreadPoolWorkItem_Invalid_Throws(bool preferLocal) { @@ -370,7 +370,7 @@ public void UnsafeQueueUserWorkItem_IThreadPoolWorkItem_Invalid_Throws(bool pref AssertExtensions.Throws("callBack", () => ThreadPool.UnsafeQueueUserWorkItem(new InvalidWorkItemAndTask(() => { }), preferLocal)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(OneBool))] public async Task UnsafeQueueUserWorkItem_IThreadPoolWorkItem_ManyIndividualItems_AllInvoked(bool preferLocal) { @@ -386,7 +386,7 @@ public async Task UnsafeQueueUserWorkItem_IThreadPoolWorkItem_ManyIndividualItem await Task.WhenAll(tasks.Select(t => t.Task)); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(OneBool))] public async Task UnsafeQueueUserWorkItem_IThreadPoolWorkItem_SameObjectReused_AllInvoked(bool preferLocal) { @@ -408,7 +408,7 @@ public async Task UnsafeQueueUserWorkItem_IThreadPoolWorkItem_SameObjectReused_A Assert.Equal(0, remaining); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(OneBool))] public async Task UnsafeQueueUserWorkItem_IThreadPoolWorkItem_ExecutionContextNotFlowed(bool preferLocal) { @@ -577,7 +577,7 @@ public void MetricsTest() }).Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunProcessorCountItemsInParallel() { int processorCount = Environment.ProcessorCount; @@ -604,7 +604,7 @@ public static void RunProcessorCountItemsInParallel() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void ThreadPoolCanPickUpOneOrMoreWorkItemsWhenThreadIsAvailable() { int processorCount = Environment.ProcessorCount; @@ -646,7 +646,7 @@ public static void ThreadPoolCanPickUpOneOrMoreWorkItemsWhenThreadIsAvailable() unblockWorkItems.Set(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunMoreThanMaxWorkItemsMakesOneWorkItemWaitForStarvationDetection() { int processorCount = Environment.ProcessorCount; @@ -674,7 +674,7 @@ public static void RunMoreThanMaxWorkItemsMakesOneWorkItemWaitForStarvationDetec unblockWorkItems.Set(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void WorkQueueDepletionTest() { ManualResetEvent done = new ManualResetEvent(false); @@ -835,7 +835,7 @@ public static void SettingMinWorkerThreadsWillCreateThreadsUpToMinimum() }).Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void ThreadPoolCanProcessManyWorkItemsInParallelWithoutDeadlocking() { int processorCount = Environment.ProcessorCount; @@ -1499,7 +1499,7 @@ public static unsafe void ThreadPoolCompletedWorkItemCountTest() } public static bool IsThreadingAndRemoteExecutorSupported => - PlatformDetection.IsThreadingSupported && RemoteExecutor.IsSupported; + PlatformDetection.IsMultithreadingSupported && RemoteExecutor.IsSupported; private static bool GetUseWindowsThreadPool() { diff --git a/src/libraries/System.Threading/tests/AsyncLocalTests.cs b/src/libraries/System.Threading/tests/AsyncLocalTests.cs index dd7f3eb2817a77..72370a7526610f 100644 --- a/src/libraries/System.Threading/tests/AsyncLocalTests.cs +++ b/src/libraries/System.Threading/tests/AsyncLocalTests.cs @@ -346,7 +346,7 @@ private static Task Run(Func func) return func(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static async Task AsyncMethodNotifications() { // diff --git a/src/libraries/System.Threading/tests/AutoResetEventTests.cs b/src/libraries/System.Threading/tests/AutoResetEventTests.cs index e79a5719664acc..c1d6f02ad253c4 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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 40ca8403faffbe..c5e14c47d7c6b4 100644 --- a/src/libraries/System.Threading/tests/BarrierCancellationTests.cs +++ b/src/libraries/System.Threading/tests/BarrierCancellationTests.cs @@ -6,7 +6,7 @@ namespace System.Threading.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static class BarrierCancellationTests { [Fact] diff --git a/src/libraries/System.Threading/tests/BarrierTests.cs b/src/libraries/System.Threading/tests/BarrierTests.cs index c6b8640cb58d29..93df6918d39b11 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [OuterLoop] public static void RunBarrierTest10a() { @@ -399,7 +399,7 @@ public static void RunBarrierTest10a() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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 29d1a2d6966174..5bd0d99c63aca1 100644 --- a/src/libraries/System.Threading/tests/CountdownEventCancellationTests.cs +++ b/src/libraries/System.Threading/tests/CountdownEventCancellationTests.cs @@ -6,7 +6,7 @@ namespace System.Threading.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static class CountdownEventCancellationTests { [Fact] diff --git a/src/libraries/System.Threading/tests/CountdownEventTests.cs b/src/libraries/System.Threading/tests/CountdownEventTests.cs index 703b4cd7f918e7..f655ec5e4da94c 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); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(0)] [InlineData(100)] public static void RunCountdownEventTest1_SimpleTimeout(int ms) diff --git a/src/libraries/System.Threading/tests/ExecutionContextTests.cs b/src/libraries/System.Threading/tests/ExecutionContextTests.cs index 178a6dc1794170..54558817984007 100644 --- a/src/libraries/System.Threading/tests/ExecutionContextTests.cs +++ b/src/libraries/System.Threading/tests/ExecutionContextTests.cs @@ -10,7 +10,7 @@ namespace System.Threading.Tests { public static class ExecutionContextTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CreateCopyTest() { ThreadTestHelpers.RunTestInBackgroundThread(() => @@ -61,7 +61,7 @@ public static void DisposeTest() executionContext.CreateCopy().Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void FlowTest() { ThreadTestHelpers.RunTestInBackgroundThread(() => @@ -178,7 +178,7 @@ public static void FlowTest() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void CaptureThenSuppressThenRunFlowTest() { ThreadTestHelpers.RunTestInBackgroundThread(() => @@ -264,7 +264,7 @@ private static void VerifyExecutionContextFlow(AsyncLocal asyncLocal, int e Assert.Equal(expectedValue, asyncLocalValue); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void AsyncFlowControlTest() { ThreadTestHelpers.RunTestInBackgroundThread(() => diff --git a/src/libraries/System.Threading/tests/HostExecutionContextManagerTests.cs b/src/libraries/System.Threading/tests/HostExecutionContextManagerTests.cs index def163c73e6089..d6f08298db09d8 100644 --- a/src/libraries/System.Threading/tests/HostExecutionContextManagerTests.cs +++ b/src/libraries/System.Threading/tests/HostExecutionContextManagerTests.cs @@ -7,7 +7,7 @@ namespace System.Threading.Tests { public static class HostExecutionContextManagerTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void BasicTest() { ThreadTestHelpers.RunTestInBackgroundThread(() => diff --git a/src/libraries/System.Threading/tests/InterlockedTests.cs b/src/libraries/System.Threading/tests/InterlockedTests.cs index 2d161983d5c684..cd394521158631 100644 --- a/src/libraries/System.Threading/tests/InterlockedTests.cs +++ b/src/libraries/System.Threading/tests/InterlockedTests.cs @@ -1308,7 +1308,7 @@ public void InterlockedOr_Generic_Unsupported() Assert.Throws(() => Interlocked.Or(ref value, default)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void InterlockedIncrement_Multithreaded_Int32() { const int ThreadCount = 10; @@ -1345,7 +1345,7 @@ public void InterlockedIncrement_Multithreaded_Int32() Assert.Equal(ThreadCount * IterationCount, Interlocked.CompareExchange(ref value, 0, 0)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void InterlockedCompareExchange_Multithreaded_Double() { const int ThreadCount = 10; @@ -1393,7 +1393,7 @@ public void InterlockedCompareExchange_Multithreaded_Double() Assert.Equal(ThreadCount * IterationCount * Increment, Interlocked.CompareExchange(ref value, 0, 0)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void InterlockedAddAndRead_Multithreaded_Int64() { const int ThreadCount = 10; @@ -1468,7 +1468,7 @@ public void MemoryBarrierIntrinsic() MemoryBarrierPointer()(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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 e180131883780e..dc34113871b3e9 100644 --- a/src/libraries/System.Threading/tests/LockTests.cs +++ b/src/libraries/System.Threading/tests/LockTests.cs @@ -106,7 +106,7 @@ public static void IsHeldByCurrentThread() Assert.False(lockObj.IsHeldByCurrentThread); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void IsHeldByCurrentThread_WhenHeldBySomeoneElse() { Lock lockObj = new(); @@ -137,7 +137,7 @@ public static void Exit_Invalid() default(Lock.Scope).Dispose(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Exit_WhenHeldBySomeoneElse_ThrowsSynchronizationLockException() { Lock lockObj = new(); @@ -194,7 +194,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.IsMultithreadingSupported))] public static void Enter_HasToWait() { Lock lockObj = new(); @@ -296,7 +296,7 @@ public static void Enter_HasToWait() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void Enter_HasToWait_LockContentionCountTest() { long initialLockContentionCount = Monitor.LockContentionCount; @@ -304,7 +304,7 @@ public static void Enter_HasToWait_LockContentionCountTest() Assert.True(Monitor.LockContentionCount - initialLockContentionCount >= 2); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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 f9ec49d70dbae8..f917ca9dfc4a8e 100644 --- a/src/libraries/System.Threading/tests/ManualResetEventSlimCancellationTests.cs +++ b/src/libraries/System.Threading/tests/ManualResetEventSlimCancellationTests.cs @@ -6,7 +6,7 @@ namespace System.Threading.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static class ManualResetEventCancellationTests { [Fact] diff --git a/src/libraries/System.Threading/tests/ManualResetEventSlimTests.cs b/src/libraries/System.Threading/tests/ManualResetEventSlimTests.cs index cbffddb27c4fbe..72bb8f10d5b957 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.IsMultithreadingSupported))] 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. - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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..17964002c6ad11 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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 3afef4f0161104..249fa2722154b6 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] public static void Enter_HasToWait() { var thinLock = new object(); @@ -397,7 +397,7 @@ public static void Enter_HasToWait() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/49521", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [ActiveIssue("https://github.com/dotnet/runtime/issues/87718", TestRuntimes.Mono)] public static void InterruptWaitTest() diff --git a/src/libraries/System.Threading/tests/MutexTests.cs b/src/libraries/System.Threading/tests/MutexTests.cs index a87522ec3211bd..0f46f4329ec1d7 100644 --- a/src/libraries/System.Threading/tests/MutexTests.cs +++ b/src/libraries/System.Threading/tests/MutexTests.cs @@ -202,7 +202,7 @@ public void MultiWaitWithAllIndexesLockedTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public void MutualExclusionTest() { var threadLocked = new AutoResetEvent(false); @@ -316,7 +316,7 @@ public void Ctor_TryCreateGlobalMutexTest_Uwp(bool currentUserOnly, bool current Assert.Throws(() => new Mutex(Guid.NewGuid().ToString("N"), options))); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(GetValidNames))] [ActiveIssue("https://github.com/dotnet/runtime/issues/117760",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void OpenExisting(string name) @@ -595,7 +595,7 @@ public static IEnumerable AbandonExisting_MemberData() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [MemberData(nameof(AbandonExisting_MemberData))] [ActiveIssue("https://github.com/dotnet/runtime/issues/117760",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void AbandonExisting( @@ -851,7 +851,7 @@ private static void IncrementValueInFileNTimes(Mutex mutex, string fileName, int } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/96191", TestPlatforms.Browser)] [ActiveIssue("https://github.com/dotnet/runtime/issues/117760",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void NamedMutex_ThreadExitDisposeRaceTest() @@ -914,7 +914,7 @@ public void NamedMutex_ThreadExitDisposeRaceTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/117760",platforms: TestPlatforms.Android, runtimes: TestRuntimes.CoreCLR)] public void NamedMutex_DisposeWhenLockedRaceTest() { diff --git a/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs b/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs index bf4fdd72cc6fdd..b1a99f205d723b 100644 --- a/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs +++ b/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs @@ -176,7 +176,7 @@ public static void DeadlockAvoidance() } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [OuterLoop] public static void ReleaseReadersWhenWaitingWriterTimesOut() { @@ -451,7 +451,7 @@ public static void ReleaseReadersWhenWaitingWriterTimesOut() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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..07392e35f2287b 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] 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 96ac716c616fea..381b633adf0c6b 100644 --- a/src/libraries/System.Threading/tests/SemaphoreSlimCancellationTests.cs +++ b/src/libraries/System.Threading/tests/SemaphoreSlimCancellationTests.cs @@ -6,7 +6,7 @@ namespace System.Threading.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static class SemaphoreSlimCancellationTests { [Fact] diff --git a/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs b/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs index 227ccda9bb8ac7..194dbbebd8df8a 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)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunSemaphoreSlimTest1_Wait() { // Infinite timeout @@ -63,14 +63,14 @@ public static void RunSemaphoreSlimTest1_Wait() RunSemaphoreSlimTest1_Wait_Helper(1, 10, TimeSpan.FromMilliseconds(uint.MaxValue), true, null); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunSemaphoreSlimTest1_Wait_NegativeCases() { // Invalid timeout RunSemaphoreSlimTest1_Wait_Helper(10, 10, -10, false, typeof(ArgumentOutOfRangeException)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunSemaphoreSlimTest1_WaitAsync() { // Infinite timeout @@ -90,7 +90,7 @@ public static void RunSemaphoreSlimTest1_WaitAsync() RunSemaphoreSlimTest1_WaitAsync_Helper(1, 10, TimeSpan.MaxValue, true, null); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/99519", TestPlatforms.Browser)] public static void RunSemaphoreSlimTest1_WaitAsync_NegativeCases() { @@ -121,7 +121,7 @@ public static void RunSemaphoreSlimTest2_Release_NegativeCases() RunSemaphoreSlimTest2_Release_Helper(int.MaxValue - 1, int.MaxValue, 10, typeof(SemaphoreFullException)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void RunSemaphoreSlimTest4_Dispose() { RunSemaphoreSlimTest4_Dispose_Helper(5, 10, null, null); @@ -136,7 +136,7 @@ public static void RunSemaphoreSlimTest4_Dispose() (5, 10, SemaphoreSlimActions.AvailableWaitHandle, typeof(ObjectDisposedException)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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 0be16cee5af633..52a635a17a0d52 100644 --- a/src/libraries/System.Threading/tests/SemaphoreTests.cs +++ b/src/libraries/System.Threading/tests/SemaphoreTests.cs @@ -274,7 +274,7 @@ public void CanWaitWithoutBlockingForReleasedCount() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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..327ceb0b17ae6b 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.IsMultithreadingSupported))] 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [InlineData(2, false)] [InlineData(128, false)] [InlineData(256, false)] @@ -193,7 +193,7 @@ public static void RunSpinLockTest1_TryEnter(int threadsCount, bool enableThread /// Number of threads that call enter/exit /// True if succeeded, false otherwise [OuterLoop] - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [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 3f2a83d3e6bae8..b92d4e28e290a5 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.IsMultithreadingSupported))] public static void WaitTest() { var tsc = new TestSynchronizationContext(); @@ -40,7 +40,7 @@ public static void WaitTest_ChangedInDotNetCore() Assert.Throws(() => TestSynchronizationContext.WaitHelper(null, false, 0)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/31977", TestRuntimes.Mono)] public static void WaitNotificationTest() { diff --git a/src/libraries/System.Threading/tests/ThreadLocalTests.cs b/src/libraries/System.Threading/tests/ThreadLocalTests.cs index 4676c8b8a2080b..70f47cac897442 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.IsMultithreadingSupported))] public static void RunThreadLocalTest4_Value() { ThreadLocal tlocal = null; @@ -223,7 +223,7 @@ public static void RunThreadLocalTest7_WeakReference() threadLocalWeakReferenceTest.Run(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/43981", TestRuntimes.Mono)] public static void RunThreadLocalTest8_Values() { @@ -368,7 +368,7 @@ public static void RunThreadLocalTest9_Uninitialized() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] public static void ValuesGetterDoesNotThrowUnexpectedExceptionWhenDisposed() { @@ -438,7 +438,7 @@ public static void ValuesGetterDoesNotThrowUnexpectedExceptionWhenDisposed() private enum UniqueEnumUsedOnlyWithNonInterferenceTest { True, False } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TestUnrelatedThreadLocalDoesNotInterfereWithTrackAllValues() { ThreadLocal localThatDoesNotTrackValues = new ThreadLocal(false); @@ -481,6 +481,6 @@ public SetMreOnFinalize(ManualResetEventSlim mres) } public static bool IsThreadingAndPreciseGcSupported => - PlatformDetection.IsThreadingSupported && PlatformDetection.IsPreciseGcSupported; + PlatformDetection.IsMultithreadingSupported && PlatformDetection.IsPreciseGcSupported; } } diff --git a/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs b/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs index c8470d61419659..54f8b41df3870a 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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] [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.IsMultithreadingSupported))] public void VerifyBYOTOpenConnSimulationTest() { // Create threads to do work @@ -1122,7 +1122,7 @@ public void VerifyBYOTOpenConnSimulationTest() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task VerifyBYOTSyncTSNestedAsync() { string txId1; @@ -1149,7 +1149,7 @@ await Task.Run(delegate }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public async Task VerifyBYOTAsyncTSNestedAsync() { string txId1; @@ -1173,7 +1173,7 @@ public async Task VerifyBYOTAsyncTSNestedAsync() AssertTransactionNull(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(TransactionScopeAsyncFlowOption.Suppress)] [InlineData(TransactionScopeAsyncFlowOption.Enabled)] public void DoTxQueueWorkItem(TransactionScopeAsyncFlowOption asyncFlowOption) @@ -1209,7 +1209,7 @@ public void DoTxQueueWorkItem(TransactionScopeAsyncFlowOption asyncFlowOption) AssertTransactionNull(); } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(TransactionScopeAsyncFlowOption.Suppress)] [InlineData(TransactionScopeAsyncFlowOption.Enabled)] public void DoTxNewThread(TransactionScopeAsyncFlowOption asyncFlowOption) diff --git a/src/libraries/System.Transactions.Local/tests/CloneTxTests.cs b/src/libraries/System.Transactions.Local/tests/CloneTxTests.cs index 4ce10e8e9eee4b..10cf2a13cbbf7e 100644 --- a/src/libraries/System.Transactions.Local/tests/CloneTxTests.cs +++ b/src/libraries/System.Transactions.Local/tests/CloneTxTests.cs @@ -157,7 +157,7 @@ public void Run(CloneType cloneType, IsolationLevel isoLevel, bool forcePromote, } [OuterLoop] // transaction timeout of 1.5 seconds per InlineData invocation. - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(CloneType.BlockingDependent, IsolationLevel.Serializable, false, TransactionStatus.Aborted)] [InlineData(CloneType.BlockingDependent, IsolationLevel.RepeatableRead, false, TransactionStatus.Aborted)] [InlineData(CloneType.BlockingDependent, IsolationLevel.ReadCommitted, false, TransactionStatus.Aborted)] diff --git a/src/libraries/System.Transactions.Local/tests/LTMEnlistmentTests.cs b/src/libraries/System.Transactions.Local/tests/LTMEnlistmentTests.cs index c686049d742b5a..58d547585bfb7d 100644 --- a/src/libraries/System.Transactions.Local/tests/LTMEnlistmentTests.cs +++ b/src/libraries/System.Transactions.Local/tests/LTMEnlistmentTests.cs @@ -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.IsMultithreadingSupported))] [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/System.Transactions.Local/tests/NonMsdtcPromoterTests.cs b/src/libraries/System.Transactions.Local/tests/NonMsdtcPromoterTests.cs index 6313200e46ada0..5d7c303296a692 100644 --- a/src/libraries/System.Transactions.Local/tests/NonMsdtcPromoterTests.cs +++ b/src/libraries/System.Transactions.Local/tests/NonMsdtcPromoterTests.cs @@ -1994,7 +1994,7 @@ public void PSPENonMsdtcAbortingCloneNotCompleted(bool promote) /// PSPE Non-MSDTC Blocking Clone Completed After Commit. /// [OuterLoop] // long delay - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void PSPENonMsdtcBlockingCloneCompletedAfterCommit(bool promote) @@ -2007,7 +2007,7 @@ public void PSPENonMsdtcBlockingCloneCompletedAfterCommit(bool promote) /// PSPE Non-MSDTC Timeout. /// [OuterLoop] // long timeout - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void PSPENonMsdtcTimeout(bool promote) @@ -2061,7 +2061,7 @@ public void PSPENonMsdtcDisposeCommittable(bool promote) /// /// PSPE Non-MSDTC Completed Event. /// - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [InlineData(false)] [InlineData(true)] public void PSPENonMsdtcCompletedEvent(bool promote) diff --git a/src/libraries/System.Transactions.Local/tests/TransactionScopeTest.cs b/src/libraries/System.Transactions.Local/tests/TransactionScopeTest.cs index 06ba17a17d3d3f..b4958958e42e74 100644 --- a/src/libraries/System.Transactions.Local/tests/TransactionScopeTest.cs +++ b/src/libraries/System.Transactions.Local/tests/TransactionScopeTest.cs @@ -505,7 +505,7 @@ public void RMFail1() Assert.Null(Transaction.Current); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] [OuterLoop] // 30 second timeout public void RMFail2() { diff --git a/src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs index 82345e3468a641..dad53629506b8f 100644 --- a/src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs @@ -77,7 +77,7 @@ public static bool IsEntered(object obj) public static bool Wait(object obj, int millisecondsTimeout) { ArgumentNullException.ThrowIfNull(obj); - Thread.ThrowIfSingleThreaded(); + RuntimeFeature.ThrowIfMultithreadingIsNotSupported(); return ObjWait(millisecondsTimeout, obj); } diff --git a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets index 74353513b2bac3..63119961e1f536 100644 --- a/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets +++ b/src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets @@ -243,6 +243,9 @@ Copyright (c) .NET Foundation. All rights reserved. + + + diff --git a/src/mono/wasm/threads.md b/src/mono/wasm/threads.md index 14afe4c1d0b5d2..16bd1c0d2e20b5 100644 --- a/src/mono/wasm/threads.md +++ b/src/mono/wasm/threads.md @@ -32,8 +32,8 @@ assemblies. ### Implementation assemblies ### The implementation (in `System.Private.CoreLib`) we check -`System.Threading.Thread.IsSingleThreaded` or call -`System.Threading.Thread.ThrowIfSingleThreaded()` to guard code paths that depends on +`System.Threading.RuntimeFeature.IsMultithreadingSupported` or call +`System.Threading.RuntimeFeature.ThrowIfMultithreadingIsNotSupported()` to guard code paths that depends on multi-threading. The property is a boolean constant that will allow the IL trimmer or the JIT/interpreter/AOT to drop the multi-threaded implementation in the single-threaded CoreLib. diff --git a/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs b/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs index 5ac0ac068f718e..bfc876c81084ee 100644 --- a/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs +++ b/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs @@ -104,9 +104,13 @@ public static bool IsMonoInterpreter public static bool IsBrowser => OperatingSystem.IsBrowser(); public static bool IsWasi => OperatingSystem.IsWasi(); public static bool IsWasm => IsBrowser || IsWasi; - public static bool IsWasmThreadingSupported => IsBrowser && IsEnvironmentVariableTrue("IsBrowserThreadingSupported"); - public static bool IsThreadingSupported => (!IsWasi && !IsBrowser) || IsWasmThreadingSupported; - public static bool IsThreadingNotSupported => !IsThreadingSupported; + + // TODO: this is compiled with 11.0.0-preview.1.26104.118\ref + // which doesn't have the RuntimeFeature.IsMultithreadingSupported API yet. + // after we update to a newer ref, we should use RuntimeFeature.IsMultithreadingSupported directly. + // public static bool IsMultithreadingSupported => RuntimeFeature.IsMultithreadingSupported; + public static bool IsMultithreadingSupported => (!IsBrowser && !IsWasi) || IsEnvironmentVariableTrue("IsBrowserThreadingSupported"); + public static bool IsNotMultithreadingSupported => !IsMultithreadingSupported; private static bool IsEnvironmentVariableTrue(string variableName) { diff --git a/src/tests/JIT/CodeGenBringUpTests/LocallocLarge.cs b/src/tests/JIT/CodeGenBringUpTests/LocallocLarge.cs index ae86c58b79e631..4319454dc03bf5 100644 --- a/src/tests/JIT/CodeGenBringUpTests/LocallocLarge.cs +++ b/src/tests/JIT/CodeGenBringUpTests/LocallocLarge.cs @@ -62,7 +62,7 @@ public static bool RunTest(int n) return ok; } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static int TestEntryPoint() { for (int j = 2; j < 1024 * 100; j += 331) diff --git a/src/tests/JIT/Directed/Misc/function_pointer/MutualThdRecur-fptr.il b/src/tests/JIT/Directed/Misc/function_pointer/MutualThdRecur-fptr.il index 951298a3ce3125..2a8a9fe12f3592 100644 --- a/src/tests/JIT/Directed/Misc/function_pointer/MutualThdRecur-fptr.il +++ b/src/tests/JIT/Directed/Misc/function_pointer/MutualThdRecur-fptr.il @@ -2993,7 +2993,7 @@ call void Thread_EA::Dispatch(method explicit instance void *(int32), int32) { .custom instance void [Microsoft.DotNet.XUnitExtensions]Xunit.ConditionalFactAttribute::.ctor(class [System.Runtime]System.Type, string[]) = { type([TestLibrary]TestLibrary.PlatformDetection) - string[1] ('IsThreadingSupported') + string[1] ('IsMultithreadingSupported') } .maxstack 4 .entrypoint diff --git a/src/tests/JIT/Methodical/cctor/misc/threads1.cs b/src/tests/JIT/Methodical/cctor/misc/threads1.cs index 171b439e38d1c0..597a6693bb79c2 100644 --- a/src/tests/JIT/Methodical/cctor/misc/threads1.cs +++ b/src/tests/JIT/Methodical/cctor/misc/threads1.cs @@ -16,7 +16,7 @@ public static void f() { test.b = 0xF; } - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [Fact] [OuterLoop] public static int TestEntryPoint() diff --git a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees-5.cs b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees-5.cs index 891844cee84d0c..3cf67a6bbc25c0 100644 --- a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees-5.cs +++ b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees-5.cs @@ -29,7 +29,7 @@ public class BinaryTrees_5 public const int MinDepth = 4; [ActiveIssue("https://github.com/dotnet/runtime/issues/86772", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [Fact] public static int TestEntryPoint() { diff --git a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees-6.cs b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees-6.cs index 3002560c7e1b5a..1edef37dbdf240 100644 --- a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees-6.cs +++ b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/binarytrees/binarytrees-6.cs @@ -36,7 +36,7 @@ public class BinaryTrees_6 const int N = 18; [ActiveIssue("https://github.com/dotnet/runtime/issues/86772", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [Fact] public static int TestEntryPoint() { diff --git a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta-1.cs b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta-1.cs index bd5110edc4adc9..9b95323e288aef 100644 --- a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta-1.cs +++ b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/fasta/fasta-1.cs @@ -39,7 +39,7 @@ public class Fasta_1 static int seed = 42; [ActiveIssue("https://github.com/dotnet/runtime/issues/86772", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/54906", TestPlatforms.Android)] [ActiveIssue("((null) error) * Assertion at runtime/src/mono/mono/metadata/assembly.c:2049, condition `is_ok (error)' not met, function:mono_assembly_load_friends, Could not load file or assembly 'xunit.performance.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=67066efe964d3b03' or one of its dependencies.", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [Fact] diff --git a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/mandelbrot/mandelbrot-7.cs b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/mandelbrot/mandelbrot-7.cs index b2f367d34497fc..18c431873542a4 100644 --- a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/mandelbrot/mandelbrot-7.cs +++ b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/mandelbrot/mandelbrot-7.cs @@ -86,7 +86,7 @@ private static unsafe byte GetByte(double* pCrb, double Ciby, int x, int y) } [ActiveIssue("https://github.com/dotnet/runtime/issues/86772", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [Fact] public static int TestEntryPoint() { diff --git a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/regex-redux/regex-redux-5.cs b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/regex-redux/regex-redux-5.cs index b4c51ef010568b..1da8ce7d3c150b 100644 --- a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/regex-redux/regex-redux-5.cs +++ b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/regex-redux/regex-redux-5.cs @@ -40,7 +40,7 @@ static string regexCount(string s, string r) } [ActiveIssue("https://github.com/dotnet/runtime/issues/86772", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/54906", TestPlatforms.Android)] [ActiveIssue("((null) error) * Assertion at runtime/src/mono/mono/metadata/assembly.c:2049, condition `is_ok (error)' not met, function:mono_assembly_load_friends, Could not load file or assembly 'xunit.performance.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=67066efe964d3b03' or one of its dependencies.", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [Fact] diff --git a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/reverse-complement-6.cs b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/reverse-complement-6.cs index 86a86263c78db9..00e1213033f040 100644 --- a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/reverse-complement-6.cs +++ b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/reverse-complement-6.cs @@ -231,7 +231,7 @@ static void Writer() } [ActiveIssue("https://github.com/dotnet/runtime/issues/86772", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/54906", TestPlatforms.Android)] [ActiveIssue("((null) error) * Assertion at runtime/src/mono/mono/metadata/assembly.c:2049, condition `is_ok (error)' not met, function:mono_assembly_load_friends, Could not load file or assembly 'xunit.performance.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=67066efe964d3b03' or one of its dependencies.", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [Fact] diff --git a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm-3.cs b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm-3.cs index b7a8d05178306a..50fa02d4568e55 100644 --- a/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm-3.cs +++ b/src/tests/JIT/Performance/CodeQuality/BenchmarksGame/spectralnorm/spectralnorm-3.cs @@ -26,7 +26,7 @@ namespace BenchmarksGame public class SpectralNorm_3 { [ActiveIssue("https://github.com/dotnet/runtime/issues/86772", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [Fact] public static int TestEntryPoint() { diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b99969/b99969.cs b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b99969/b99969.cs index 42f8433d5e7cd1..833c9a1456f99e 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b99969/b99969.cs +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V1-M13-RTM/b99969/b99969.cs @@ -61,7 +61,7 @@ private int Function() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public static int TestEntryPoint() { Test_b99969 t = new Test_b99969(); diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b425314/b425314.cs b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b425314/b425314.cs index b966b9f5ff8866..ea19f3e4652644 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b425314/b425314.cs +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b425314/b425314.cs @@ -935,7 +935,7 @@ internal static void RecordFailure(Exception ex) } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [SkipOnCoreClr("This test takes too long and internally times out under GCStress/heap verify. It is not fundamentally incompatible if stress testing is fast enough.", RuntimeTestModes.AnyGCStress | RuntimeTestModes.HeapVerify)] public static int TestEntryPoint() { diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_27924/GitHub_27924.cs b/src/tests/JIT/Regression/JitBlue/GitHub_27924/GitHub_27924.cs index bedd3224c28dc9..01a92ec5ad83c0 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_27924/GitHub_27924.cs +++ b/src/tests/JIT/Regression/JitBlue/GitHub_27924/GitHub_27924.cs @@ -40,7 +40,7 @@ static void Work() } } - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [Fact] public static int TestEntryPoint() { diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_40444/Runtime_40444.cs b/src/tests/JIT/Regression/JitBlue/Runtime_40444/Runtime_40444.cs index 558c40693dd0fe..fbbb92a90c9353 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_40444/Runtime_40444.cs +++ b/src/tests/JIT/Regression/JitBlue/Runtime_40444/Runtime_40444.cs @@ -117,7 +117,7 @@ static bool Test(ref bool result) } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public static int TestEntryPoint() { bool passes_test = false; diff --git a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10827/MT_DEATH.cs b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10827/MT_DEATH.cs index a42b153c0d3eda..64b528dfd8286e 100644 --- a/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10827/MT_DEATH.cs +++ b/src/tests/JIT/Regression/VS-ia64-JIT/V1.2-M01/b10827/MT_DEATH.cs @@ -20830,7 +20830,7 @@ internal void Fire() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] public static int TestEntryPoint() { int Sum = 0; diff --git a/src/tests/JIT/jit64/opt/rngchk/ArrayWithThread.cs b/src/tests/JIT/jit64/opt/rngchk/ArrayWithThread.cs index 62478fb5152116..c090a863b8f849 100644 --- a/src/tests/JIT/jit64/opt/rngchk/ArrayWithThread.cs +++ b/src/tests/JIT/jit64/opt/rngchk/ArrayWithThread.cs @@ -17,7 +17,7 @@ public class Class1 public static ManualResetEvent myResetEvent2 = new ManualResetEvent(false); [ActiveIssue("times out", typeof(PlatformDetection), nameof(PlatformDetection.IsArmProcess))] [SkipOnCoreClr("", RuntimeTestModes.AnyGCStress)] - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static int TestEntryPoint() { int retVal = 100; diff --git a/src/tests/JIT/opt/Devirtualization/box2.cs b/src/tests/JIT/opt/Devirtualization/box2.cs index 309a75e0482c18..aaffec992b1e5c 100644 --- a/src/tests/JIT/opt/Devirtualization/box2.cs +++ b/src/tests/JIT/opt/Devirtualization/box2.cs @@ -21,7 +21,7 @@ static async Task TestTask() } } - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [Fact] public static void TestEntryPoint() => Task.Run(TestTask).Wait(); } diff --git a/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorTwoThreadsThreeCC.cs b/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorTwoThreadsThreeCC.cs index 43b34a535cef1b..d902d61b1fdf4c 100644 --- a/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorTwoThreadsThreeCC.cs +++ b/src/tests/Loader/classloader/TypeInitialization/CircularCctors/CircularCctorTwoThreadsThreeCC.cs @@ -130,7 +130,7 @@ public static void Log(string msg) Console.WriteLine ($"{Thread.CurrentThread.ManagedThreadId}: {msg}"); } - [ActiveIssue("System.Threading.Thread.ThrowIfSingleThreaded: PlatformNotSupportedException", TestPlatforms.Browser)] + [SkipOnPlatform(TestPlatforms.Browser, "Requires threads")] [Fact] public static void RunTestCase() { diff --git a/src/tests/Loader/classloader/TypeInitialization/CoreCLR/CircularCctorThreeThreads03.cs b/src/tests/Loader/classloader/TypeInitialization/CoreCLR/CircularCctorThreeThreads03.cs index 712e71a87d651c..2a6f9ec240c688 100644 --- a/src/tests/Loader/classloader/TypeInitialization/CoreCLR/CircularCctorThreeThreads03.cs +++ b/src/tests/Loader/classloader/TypeInitialization/CoreCLR/CircularCctorThreeThreads03.cs @@ -145,7 +145,7 @@ public static void RunGetE() } - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [Fact] public static int TestEntryPoint() { diff --git a/src/tests/Loader/classloader/regressions/523654/test532654_b.cs b/src/tests/Loader/classloader/regressions/523654/test532654_b.cs index 75d9bc7b28a90f..2cb6c388bdb01f 100644 --- a/src/tests/Loader/classloader/regressions/523654/test532654_b.cs +++ b/src/tests/Loader/classloader/regressions/523654/test532654_b.cs @@ -115,7 +115,7 @@ public static void RunTestThread10() } - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [Fact] public static int TestEntryPoint() { diff --git a/src/tests/baseservices/threading/DeadThreads/DeadThreads.cs b/src/tests/baseservices/threading/DeadThreads/DeadThreads.cs index b2d6ca48f1c4ce..858e47ad57a845 100644 --- a/src/tests/baseservices/threading/DeadThreads/DeadThreads.cs +++ b/src/tests/baseservices/threading/DeadThreads/DeadThreads.cs @@ -17,7 +17,7 @@ public class DeadThreads /// set DOTNET_Thread_DeadThreadCountThresholdForGCTrigger=8 /// set DOTNET_Thread_DeadThreadGCTriggerPeriodMilliseconds=3e8 // 1000 /// - [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingNotSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/41472", typeof(PlatformDetection), nameof(PlatformDetection.IsNotMultithreadingSupported))] [Fact] public static void GCTriggerSanityTest() { diff --git a/src/tests/baseservices/threading/coverage/OSThreadId/OSThreadId.cs b/src/tests/baseservices/threading/coverage/OSThreadId/OSThreadId.cs index c4afabe4ff7e89..27709e02976239 100644 --- a/src/tests/baseservices/threading/coverage/OSThreadId/OSThreadId.cs +++ b/src/tests/baseservices/threading/coverage/OSThreadId/OSThreadId.cs @@ -14,7 +14,7 @@ public sealed class OSThreadId private static ManualResetEvent s_resetEvent = new ManualResetEvent(false); private static ulong[] s_threadIds = new ulong[NumThreads]; - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMultithreadingSupported))] public static void TestEntryPoint() { // The property to be tested is internal.