From c865deae8df53b431e1532ae415aba993ab73f03 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Fri, 30 Jul 2021 08:01:57 -0400 Subject: [PATCH] Enable and tweak ThreadTests on Android (#56578) Many ThreadTests should be working on Android, so they were enabled. ApartmentState_AttributePresent was changed to skip permanently on Android. Fixes https://github.com/dotnet/runtime/issues/50577 --- .../System.Threading.Thread/tests/ThreadTests.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/libraries/System.Threading.Thread/tests/ThreadTests.cs b/src/libraries/System.Threading.Thread/tests/ThreadTests.cs index 23a9c0d..ced0b01 100644 --- a/src/libraries/System.Threading.Thread/tests/ThreadTests.cs +++ b/src/libraries/System.Threading.Thread/tests/ThreadTests.cs @@ -158,9 +158,7 @@ namespace System.Threading.Threads.Tests }; } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/34543", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] - [SkipOnPlatform(TestPlatforms.Browser, "System.Diagnostics.Process is not supported on this platform.")] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer), nameof(PlatformDetection.IsNotMobile))] [InlineData("STAMain.exe", "GetApartmentStateTest")] [InlineData("STAMain.exe", "SetApartmentStateTest")] [InlineData("STAMain.exe", "WaitAllNotSupportedOnSta_Test0")] @@ -169,8 +167,9 @@ namespace System.Threading.Threads.Tests [InlineData("MTAMain.exe", "SetApartmentStateTest")] [InlineData("DefaultApartmentStateMain.exe", "GetApartmentStateTest")] [InlineData("DefaultApartmentStateMain.exe", "SetApartmentStateTest")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50577", TestPlatforms.Android)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34543", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "Not supported on iOS, MacCatalyst, or tvOS.")] + [SkipOnPlatform(TestPlatforms.Browser, "System.Diagnostics.Process is not supported on this platform.")] public static void ApartmentState_AttributePresent(string appName, string testName) { var psi = new ProcessStartInfo(); @@ -577,7 +576,6 @@ namespace System.Threading.Threads.Tests } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50577", TestPlatforms.Android)] public static void IsThreadPoolThreadTest() { var isThreadPoolThread = false; @@ -602,7 +600,6 @@ namespace System.Threading.Threads.Tests } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50577", TestPlatforms.Android)] public static void ManagedThreadIdTest() { var e = new ManualResetEvent(false); @@ -673,7 +670,6 @@ namespace System.Threading.Threads.Tests } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50577", TestPlatforms.Android)] public static void PriorityTest() { var e = new ManualResetEvent(false); @@ -692,7 +688,6 @@ namespace System.Threading.Threads.Tests } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50577", TestPlatforms.Android)] public static void ThreadStateTest() { var e0 = new ManualResetEvent(false); @@ -730,7 +725,6 @@ namespace System.Threading.Threads.Tests } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50577", TestPlatforms.Android)] public static void AbortSuspendTest() { var e = new ManualResetEvent(false); @@ -921,7 +915,6 @@ namespace System.Threading.Threads.Tests [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/49521", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50577", TestPlatforms.Android)] public static void InterruptTest() { // Interrupting a thread that is not blocked does not do anything, but once the thread starts blocking, it gets @@ -997,7 +990,6 @@ namespace System.Threading.Threads.Tests } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50577", TestPlatforms.Android)] public static void JoinTest() { var threadReady = new ManualResetEvent(false); @@ -1049,7 +1041,6 @@ namespace System.Threading.Threads.Tests [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [InlineData(false)] [InlineData(true)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50577", TestPlatforms.Android)] public static void StartTest(bool useUnsafeStart) { void Start(Thread t) -- 2.7.4