Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/libraries/System.Threading.ThreadPool/tests/ThreadPoolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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" })
Comment thread
eduardo-vp marked this conversation as resolved.
{
string path = $"/sys/devices/system/cpu/{entry}";
try
{
string value = System.IO.File.Exists(path)
? System.IO.File.ReadAllText(path).Trim()
: "<not present>";
Console.WriteLine($"{path} = {value}");
}
catch (Exception ex)
{
Console.WriteLine($"{path} = <error: {ex.GetType().Name}: {ex.Message}>");
}
}

Console.WriteLine("=====================================================");

if (OperatingSystem.IsAndroid())
{
throw new Exception("Just fail on android");
}
Comment thread
eduardo-vp marked this conversation as resolved.

AutoResetEvent allBlockingWorkItemsStarted = new AutoResetEvent(false);
AutoResetEvent allTestWorkItemsStarted = new AutoResetEvent(false);
ManualResetEvent unblockWorkItems = new ManualResetEvent(false);
Expand Down
26 changes: 26 additions & 0 deletions src/tests/nativeaot/SmokeTests/Exceptions/Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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" })
Comment thread
eduardo-vp marked this conversation as resolved.
{
string path = $"/sys/devices/system/cpu/{entry}";
try
{
string value = System.IO.File.Exists(path)
? System.IO.File.ReadAllText(path).Trim()
: "<not present>";
Console.WriteLine($"{path} = {value}");
}
catch (Exception ex)
{
Console.WriteLine($"{path} = <error: {ex.GetType().Name}: {ex.Message}>");
}
}

Console.WriteLine("=====================================================");

if (OperatingSystem.IsAndroid())
{
return 42;
}

// This test also doubles as server GC test
if (Environment.ProcessorCount > 1 && !System.Runtime.GCSettings.IsServerGC)
Expand Down
Loading