diff --git a/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostControllersTestHost.cs b/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostControllersTestHost.cs index 25bfabac0b..750162e61e 100644 --- a/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostControllersTestHost.cs +++ b/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostControllersTestHost.cs @@ -36,6 +36,7 @@ internal sealed class TestHostControllersTestHost : CommonHost, IHost, IDisposab private int? _testHostExitCode; private int? _testHostPID; + [UnsupportedOSPlatform("browser")] public TestHostControllersTestHost(TestHostControllerConfiguration testHostsInformation, ServiceProvider serviceProvider, PassiveNode? passiveNode, IEnvironment environment, ILoggerFactory loggerFactory, IClock clock) : base(serviceProvider) @@ -107,7 +108,6 @@ protected override async Task InternalRunAsync() string arguments = string.Join(' ', partialCommandLine); #endif -#pragma warning disable CA1416 // Validate platform compatibility ProcessStartInfo processStartInfo = new( executableInfo.FilePath, arguments) @@ -123,7 +123,6 @@ protected override async Task InternalRunAsync() UseShellExecute = false, #endif }; -#pragma warning restore CA1416 List dataConsumersBuilder = [.. _testHostsInformation.DataConsumer]; @@ -211,9 +210,7 @@ protected override async Task InternalRunAsync() foreach (EnvironmentVariable envVar in environmentVariables.GetAll()) { -#pragma warning disable CA1416 // Validate platform compatibility processStartInfo.EnvironmentVariables[envVar.Variable] = envVar.Value; -#pragma warning restore CA1416 } } @@ -228,13 +225,9 @@ protected override async Task InternalRunAsync() // Launch the test host process string testHostProcessStartupTime = _clock.UtcNow.ToString("HH:mm:ss.fff", CultureInfo.InvariantCulture); -#pragma warning disable CA1416 // Validate platform compatibility processStartInfo.EnvironmentVariables.Add($"{EnvironmentVariableConstants.TESTINGPLATFORM_TESTHOSTCONTROLLER_TESTHOSTPROCESSSTARTTIME}_{currentPid}", testHostProcessStartupTime); -#pragma warning restore CA1416 await _logger.LogDebugAsync($"{EnvironmentVariableConstants.TESTINGPLATFORM_TESTHOSTCONTROLLER_TESTHOSTPROCESSSTARTTIME}_{currentPid} '{testHostProcessStartupTime}'").ConfigureAwait(false); -#pragma warning disable CA1416 // Validate platform compatibility await _logger.LogDebugAsync($"Starting test host process '{processStartInfo.FileName}' with args '{processStartInfo.Arguments}'").ConfigureAwait(false); -#pragma warning restore CA1416 using IProcess testHostProcess = process.Start(processStartInfo); int? testHostProcessId = null; @@ -274,9 +267,7 @@ protected override async Task InternalRunAsync() // Wait for the test host controller to send the PID of the test host process using (CancellationTokenSource timeout = new(TimeoutHelper.DefaultHangTimeSpanTimeout)) { -#pragma warning disable CA1416 // Validate platform compatibility _waitForPid.Wait(timeout.Token); -#pragma warning restore CA1416 } await _logger.LogDebugAsync("Fire OnTestHostProcessStartedAsync").ConfigureAwait(false);