From 4028e601d1af400c87773a0d784190341a8043cd Mon Sep 17 00:00:00 2001 From: Eduardo Velarde Date: Mon, 20 Jul 2026 19:04:14 -0700 Subject: [PATCH 1/2] test android cpu files --- .../SmokeTests/Exceptions/Exceptions.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.cs b/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.cs index 1b3a4e7d52a3d9..7d2db763d9d79b 100644 --- a/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.cs +++ b/src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.cs @@ -26,6 +26,32 @@ public BringUpTest() public static int Main() { + Console.WriteLine($"Environment.ProcessorCount = {Environment.ProcessorCount}"); + Console.WriteLine($"GCSettings.IsServerGC = {System.Runtime.GCSettings.IsServerGC}"); + Console.WriteLine($"OperatingSystem.IsAndroid = {OperatingSystem.IsAndroid()}"); + + foreach (string entry in new[] { "possible", "present", "online", "offline" }) + { + string path = $"/sys/devices/system/cpu/{entry}"; + try + { + string value = System.IO.File.Exists(path) + ? System.IO.File.ReadAllText(path).Trim() + : ""; + Console.WriteLine($"{path} = {value}"); + } + catch (Exception ex) + { + Console.WriteLine($"{path} = "); + } + } + + Console.WriteLine("====================================================="); + + if (OperatingSystem.IsAndroid()) + { + return 42; + } // This test also doubles as server GC test if (Environment.ProcessorCount > 1 && !System.Runtime.GCSettings.IsServerGC) From 8cec4fea586cc4895691d12f073e97ef171e8a71 Mon Sep 17 00:00:00 2001 From: Eduardo Velarde Date: Mon, 20 Jul 2026 19:41:31 -0700 Subject: [PATCH 2/2] not native aot only --- .../tests/ThreadPoolTests.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs b/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs index d61ab0f8968c8c..d8321ee45d8dc9 100644 --- a/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs +++ b/src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs @@ -608,6 +608,34 @@ public static void RunProcessorCountItemsInParallel() public static void ThreadPoolCanPickUpOneOrMoreWorkItemsWhenThreadIsAvailable() { int processorCount = Environment.ProcessorCount; + + Console.WriteLine($"Environment.ProcessorCount = {Environment.ProcessorCount}"); + Console.WriteLine($"GCSettings.IsServerGC = {System.Runtime.GCSettings.IsServerGC}"); + Console.WriteLine($"OperatingSystem.IsAndroid = {OperatingSystem.IsAndroid()}"); + + foreach (string entry in new[] { "possible", "present", "online", "offline" }) + { + string path = $"/sys/devices/system/cpu/{entry}"; + try + { + string value = System.IO.File.Exists(path) + ? System.IO.File.ReadAllText(path).Trim() + : ""; + Console.WriteLine($"{path} = {value}"); + } + catch (Exception ex) + { + Console.WriteLine($"{path} = "); + } + } + + Console.WriteLine("====================================================="); + + if (OperatingSystem.IsAndroid()) + { + throw new Exception("Just fail on android"); + } + AutoResetEvent allBlockingWorkItemsStarted = new AutoResetEvent(false); AutoResetEvent allTestWorkItemsStarted = new AutoResetEvent(false); ManualResetEvent unblockWorkItems = new ManualResetEvent(false);