diff --git a/src/tests/EventPipeStress/Orchestrator/Orchestrator.csproj b/src/tests/EventPipeStress/Orchestrator/Orchestrator.csproj
index 063a1c1ce4..020212c80d 100644
--- a/src/tests/EventPipeStress/Orchestrator/Orchestrator.csproj
+++ b/src/tests/EventPipeStress/Orchestrator/Orchestrator.csproj
@@ -2,7 +2,7 @@
Exe
- net5.0
+ net6.0
diff --git a/src/tests/EventPipeStress/Orchestrator/Program.cs b/src/tests/EventPipeStress/Orchestrator/Program.cs
index 34e867916d..c8da1b00e6 100644
--- a/src/tests/EventPipeStress/Orchestrator/Program.cs
+++ b/src/tests/EventPipeStress/Orchestrator/Program.cs
@@ -16,6 +16,7 @@
using Microsoft.Diagnostics.Tracing;
using Process = System.Diagnostics.Process;
+using System.Runtime.Versioning;
namespace Orchestrator
{
@@ -191,6 +192,10 @@ static Func UseFS(bool rundown, int bufferSize)
};
}
+ [SupportedOSPlatformGuard("Windows")]
+ [SupportedOSPlatformGuard("Linux")]
+ static bool IsWindowsOrLinux => OperatingSystem.IsLinux() || OperatingSystem.IsWindows();
+
static async Task Orchestrate(
IConsole console,
CancellationToken ct,
@@ -254,7 +259,8 @@ static async Task Orchestrate(
eventWritingProc.Start();
Console.WriteLine($"Executing: {eventWritingProc.StartInfo.FileName} {eventWritingProc.StartInfo.Arguments}");
- if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+
+ if (IsWindowsOrLinux)
{
// Set affinity and priority
ulong affinityMask = 0;
@@ -263,7 +269,6 @@ static async Task Orchestrate(
affinityMask |= ((ulong)1 << j);
}
eventWritingProc.ProcessorAffinity = (IntPtr)((ulong)eventWritingProc.ProcessorAffinity & affinityMask);
- eventWritingProc.PriorityClass = ProcessPriorityClass.RealTime; // Set the process priority to highest possible
}
// Start listening to the event.
diff --git a/src/tests/EventPipeStress/Stress/Stress.csproj b/src/tests/EventPipeStress/Stress/Stress.csproj
index 1f797977b0..24cd03482b 100644
--- a/src/tests/EventPipeStress/Stress/Stress.csproj
+++ b/src/tests/EventPipeStress/Stress/Stress.csproj
@@ -2,7 +2,7 @@
Exe
- net5.0
+ net6.0