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); 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)