From ee5b738d482b2bf72a5d6aab486e770490ade194 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Wed, 10 Aug 2022 10:14:51 -0700 Subject: [PATCH] [Android] Enable ThreadPoolCanPickUpOneOrMoreWorkItemsWhenThreadIsAvailable test (#73487) * [Android] Enable ThreadPoolCanPickUpOneOrMoreWorkItemsWhenThreadIsAvailable test * Tweak ThreadPoolTest when there is 1 core Co-authored-by: Steve Pfister Co-authored-by: mdh1418 --- .../System.Threading.ThreadPool/tests/ThreadPoolTests.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs b/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs index f0017ea83c9c6..dfef12aa200bd 100644 --- a/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs +++ b/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs @@ -599,7 +599,6 @@ public static void RunProcessorCountItemsInParallel() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/43754", TestPlatforms.Android)] public static void ThreadPoolCanPickUpOneOrMoreWorkItemsWhenThreadIsAvailable() { int processorCount = Environment.ProcessorCount; @@ -629,7 +628,9 @@ public static void ThreadPoolCanPickUpOneOrMoreWorkItemsWhenThreadIsAvailable() ThreadPool.QueueUserWorkItem(blockingWorkItem); } - allBlockingWorkItemsStarted.CheckedWait(); + if (processorCount > 1) + allBlockingWorkItemsStarted.CheckedWait(); + for (int i = 0; i < processorCount; ++i) { ThreadPool.QueueUserWorkItem(testWorkItem);