Skip to content

Commit

Permalink
Enable and tweak ThreadTests on Android (#56578)
Browse files Browse the repository at this point in the history
Many ThreadTests should be working on Android, so they were enabled.  ApartmentState_AttributePresent was changed to skip permanently on Android.

Fixes #50577
  • Loading branch information
steveisok committed Jul 30, 2021
1 parent 23f0fe4 commit c865dea
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/libraries/System.Threading.Thread/tests/ThreadTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ public static IEnumerable<object[]> ApartmentStateTest_MemberData()
};
}

[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")]
Expand All @@ -169,8 +167,9 @@ public static IEnumerable<object[]> ApartmentStateTest_MemberData()
[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();
Expand Down Expand Up @@ -577,7 +576,6 @@ public static void IsBackgroundTest()
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/50577", TestPlatforms.Android)]
public static void IsThreadPoolThreadTest()
{
var isThreadPoolThread = false;
Expand All @@ -602,7 +600,6 @@ public static void IsThreadPoolThreadTest()
}

[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);
Expand Down Expand Up @@ -673,7 +670,6 @@ public static void ThreadNameDoesNotAffectProcessName()
}

[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);
Expand All @@ -692,7 +688,6 @@ public static void PriorityTest()
}

[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);
Expand Down Expand Up @@ -730,7 +725,6 @@ public static void ThreadStateTest()
}

[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);
Expand Down Expand Up @@ -921,7 +915,6 @@ public static void LocalDataSlotTest()

[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
Expand Down Expand Up @@ -997,7 +990,6 @@ public static void InterruptInFinallyBlockTest_SkipOnDesktopFramework()
}

[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);
Expand Down Expand Up @@ -1049,7 +1041,6 @@ public static void SleepTest()
[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)
Expand Down

0 comments on commit c865dea

Please sign in to comment.