From beb279da00471df3c744e9e37b782d025a7ad935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 11 Jun 2026 03:57:09 +0200 Subject: [PATCH 1/7] Include testhost process path in crash error messages When testhost crashes, the error message now includes the full path to the testhost executable that was launched. This helps users diagnose issues where the wrong testhost is launched or there are path-related problems. Fixes #2952 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Client/ProxyOperationManager.cs | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs index 3a17bcc276..dd1db2bca8 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs @@ -51,6 +51,7 @@ public class ProxyOperationManager private bool _testHostLaunched; private int _testHostProcessId; private string? _testHostProcessStdError; + private string? _testHostProcessFileName; /// /// Initializes a new instance of the class. @@ -231,6 +232,7 @@ public virtual bool SetupChannel(IEnumerable sources, string? runSetting sources, envVars, connectionInfo)); + _testHostProcessFileName = testHostStartInfo.FileName; try { // Launch the test host. @@ -512,7 +514,7 @@ private void TestHostManagerHostExited(object? sender, HostProviderEventArgs? e) // If not it reports timeout, if we don't set this before OnClientProcessExit we will // report timeout even though we exited the test host before even attempting the connect. _testHostExited.Set(); - RequestSender.OnClientProcessExit(_testHostProcessStdError); + RequestSender.OnClientProcessExit(BuildCrashErrorContext(_testHostProcessFileName, _testHostProcessStdError)); } private void ThrowOnTestHostExited(IEnumerable sources, bool testHostExited) @@ -521,7 +523,7 @@ private void ThrowOnTestHostExited(IEnumerable sources, bool testHostExi { // We might consider passing standard output here in case standard error is not // available because some errors don't end up in the standard error output. - throw new TestPlatformException(string.Format(CultureInfo.CurrentCulture, CrossPlatEngineResources.TestHostExitedWithError, string.Join("', '", sources), _testHostProcessStdError)); + throw new TestPlatformException(string.Format(CultureInfo.CurrentCulture, CrossPlatEngineResources.TestHostExitedWithError, string.Join("', '", sources), BuildCrashErrorContext(_testHostProcessFileName, _testHostProcessStdError))); } } @@ -552,12 +554,26 @@ private void ThrowExceptionOnConnectionFailure(IEnumerable sources, int } // After testhost process launched failed with error. - if (!StringUtils.IsNullOrWhiteSpace(_testHostProcessStdError)) + if (!StringUtils.IsNullOrWhiteSpace(_testHostProcessStdError) || !StringUtils.IsNullOrWhiteSpace(_testHostProcessFileName)) { // Testhost failed with error. - errorMsg = string.Format(CultureInfo.CurrentCulture, CrossPlatEngineResources.TestHostExitedWithError, string.Join("', '", sources), _testHostProcessStdError); + errorMsg = string.Format(CultureInfo.CurrentCulture, CrossPlatEngineResources.TestHostExitedWithError, string.Join("', '", sources), BuildCrashErrorContext(_testHostProcessFileName, _testHostProcessStdError)); } throw new TestPlatformException(errorMsg); } + + private static string BuildCrashErrorContext(string? processFileName, string? stdError) + { + var hasPath = !StringUtils.IsNullOrWhiteSpace(processFileName); + var hasError = !StringUtils.IsNullOrWhiteSpace(stdError); + + return (hasPath, hasError) switch + { + (true, true) => $"Process path: {processFileName}{Environment.NewLine}{stdError}", + (true, false) => $"Process path: {processFileName}", + (false, true) => stdError!, + _ => string.Empty, + }; + } } From ca86acf8b45a3978ee5a601b8cef3f23a779c25a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 11 Jun 2026 04:21:35 +0200 Subject: [PATCH 2/7] fix: preserve timeout diagnostics in ThrowExceptionOnConnectionFailure Only replace the error message with TestHostExitedWithError when stderr is present (i.e., the process actually crashed). For the normal timeout case, _testHostProcessFileName is set unconditionally before every launch, so the previous OR condition fired on every launch and overwrote the informative timeout message (elapsed seconds, process ID, VSTEST_CONNECTION_TIMEOUT hint) with a misleading 'exited with error' message even when the process was still running. Now: stderr present -> replace with crash error message (same as before) no stderr, but path available -> append path as addendum to existing message neither -> leave message unchanged (backward-compatible) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Client/ProxyOperationManager.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs index dd1db2bca8..bd4f0eec4b 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs @@ -553,12 +553,17 @@ private void ThrowExceptionOnConnectionFailure(IEnumerable sources, int } } - // After testhost process launched failed with error. - if (!StringUtils.IsNullOrWhiteSpace(_testHostProcessStdError) || !StringUtils.IsNullOrWhiteSpace(_testHostProcessFileName)) + // After testhost process crashed (stderr present), replace the message with a diagnostic one. + if (!StringUtils.IsNullOrWhiteSpace(_testHostProcessStdError)) { // Testhost failed with error. errorMsg = string.Format(CultureInfo.CurrentCulture, CrossPlatEngineResources.TestHostExitedWithError, string.Join("', '", sources), BuildCrashErrorContext(_testHostProcessFileName, _testHostProcessStdError)); } + else if (!StringUtils.IsNullOrWhiteSpace(_testHostProcessFileName)) + { + // Process launched but no stderr — append path as a diagnostic addendum without overwriting the timeout message. + errorMsg += $" Process path: {_testHostProcessFileName}"; + } throw new TestPlatformException(errorMsg); } From 2aaace0f0d7d88a1038c38389ea537b9020a1b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 11 Jun 2026 09:00:30 +0200 Subject: [PATCH 3/7] refactor: remove redundant comment in ThrowExceptionOnConnectionFailure Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Client/ProxyOperationManager.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs index bd4f0eec4b..2f91ba0e7c 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs @@ -556,7 +556,6 @@ private void ThrowExceptionOnConnectionFailure(IEnumerable sources, int // After testhost process crashed (stderr present), replace the message with a diagnostic one. if (!StringUtils.IsNullOrWhiteSpace(_testHostProcessStdError)) { - // Testhost failed with error. errorMsg = string.Format(CultureInfo.CurrentCulture, CrossPlatEngineResources.TestHostExitedWithError, string.Join("', '", sources), BuildCrashErrorContext(_testHostProcessFileName, _testHostProcessStdError)); } else if (!StringUtils.IsNullOrWhiteSpace(_testHostProcessFileName)) From e52c37dad218fd2f71d476815714ba1a2d2f5783 Mon Sep 17 00:00:00 2001 From: Azat Mukhametshin Date: Thu, 11 Jun 2026 17:26:41 +0200 Subject: [PATCH 4/7] resolving copilot comments --- .../Client/ProxyOperationManager.cs | 2 +- .../Client/ProxyOperationManagerTests.cs | 147 ++++++++++++++++++ 2 files changed, 148 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs index 2f91ba0e7c..ef5ce17b32 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs @@ -561,7 +561,7 @@ private void ThrowExceptionOnConnectionFailure(IEnumerable sources, int else if (!StringUtils.IsNullOrWhiteSpace(_testHostProcessFileName)) { // Process launched but no stderr — append path as a diagnostic addendum without overwriting the timeout message. - errorMsg += $" Process path: {_testHostProcessFileName}"; + errorMsg += BuildCrashErrorContext(_testHostProcessFileName, null); } throw new TestPlatformException(errorMsg); diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs index 6cb8aa5060..0e44873789 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs @@ -441,6 +441,153 @@ public void CloseShouldNotThrowIfEndSessionFails() _testOperationManager.Close(); } + [TestMethod] + public void SetupChannelShouldIncludeProcessPathAndStdErrorWhenTestHostExitsWithBoth() + { + var processPath = @"C:\testhost.exe"; + var stdError = "Unhandled exception. System.Exception: Boom"; + + _mockTestHostManager.Setup( + m => m.GetTestHostProcessStartInfo( + It.IsAny>(), + It.IsAny>(), + It.IsAny())) + .Returns(new TestProcessStartInfo { FileName = processPath }); + + _mockTestHostManager.Setup(tmh => tmh.LaunchTestHostAsync(It.IsAny(), It.IsAny())) + .Callback(() => + { + _mockTestHostManager.Raise(t => t.HostLaunched += null, new HostProviderEventArgs(string.Empty)); + _mockTestHostManager.Raise(t => t.HostExited += null, new HostProviderEventArgs(stdError)); + }) + .Returns(Task.FromResult(true)); + + _mockRequestSender.Setup(rs => rs.WaitForRequestHandlerConnection(It.IsAny(), It.IsAny())).Returns(false); + + var operationManager = new TestableProxyOperationManager(_mockRequestData.Object, _mockRequestSender.Object, _mockTestHostManager.Object); + + var ex = Assert.ThrowsExactly(() => operationManager.SetupChannel(["test.dll"], DefaultRunSettings)); + Assert.Contains("Process path:", ex.Message); + Assert.Contains(processPath, ex.Message); + Assert.Contains(stdError, ex.Message); + } + + [TestMethod] + public void SetupChannelShouldIncludeOnlyStdErrorWhenProcessPathIsNull() + { + var stdError = "Unhandled exception. System.Exception: Boom"; + + _mockTestHostManager.Setup( + m => m.GetTestHostProcessStartInfo( + It.IsAny>(), + It.IsAny>(), + It.IsAny())) + .Returns(new TestProcessStartInfo { FileName = null }); + + _mockTestHostManager.Setup(tmh => tmh.LaunchTestHostAsync(It.IsAny(), It.IsAny())) + .Callback(() => + { + _mockTestHostManager.Raise(t => t.HostLaunched += null, new HostProviderEventArgs(string.Empty)); + _mockTestHostManager.Raise(t => t.HostExited += null, new HostProviderEventArgs(stdError)); + }) + .Returns(Task.FromResult(true)); + + _mockRequestSender.Setup(rs => rs.WaitForRequestHandlerConnection(It.IsAny(), It.IsAny())).Returns(false); + + var operationManager = new TestableProxyOperationManager(_mockRequestData.Object, _mockRequestSender.Object, _mockTestHostManager.Object); + + var ex = Assert.ThrowsExactly(() => operationManager.SetupChannel(["test.dll"], DefaultRunSettings)); + Assert.Contains(stdError, ex.Message); + Assert.DoesNotContain(ex.Message, "Process path:"); + } + + [TestMethod] + public void SetupChannelShouldIncludeProcessPathWhenTestHostTimesOutWithNoStdError() + { + var processPath = @"C:\testhost.exe"; + + _mockTestHostManager.Setup( + m => m.GetTestHostProcessStartInfo( + It.IsAny>(), + It.IsAny>(), + It.IsAny())) + .Returns(new TestProcessStartInfo { FileName = processPath }); + + _mockTestHostManager.Setup(tmh => tmh.LaunchTestHostAsync(It.IsAny(), It.IsAny())) + .Callback(() => _mockTestHostManager.Raise(t => t.HostLaunched += null, new HostProviderEventArgs(string.Empty))) + .Returns(Task.FromResult(true)); + + _mockRequestSender.Setup(rs => rs.WaitForRequestHandlerConnection(It.IsAny(), It.IsAny())).Returns(false); + + var operationManager = new TestableProxyOperationManager(_mockRequestData.Object, _mockRequestSender.Object, _mockTestHostManager.Object); + + var ex = Assert.ThrowsExactly(() => operationManager.SetupChannel(["test.dll"], DefaultRunSettings)); + Assert.Contains($"Process path: {processPath}", ex.Message); + } + + [TestMethod] + public void SetupChannelShouldPassCrashContextToRequestSenderOnTestHostExit() + { + var processPath = @"C:\testhost.exe"; + var stdError = "Fatal error"; + + _mockTestHostManager.Setup( + m => m.GetTestHostProcessStartInfo( + It.IsAny>(), + It.IsAny>(), + It.IsAny())) + .Returns(new TestProcessStartInfo { FileName = processPath }); + + _mockTestHostManager.Setup(tmh => tmh.LaunchTestHostAsync(It.IsAny(), It.IsAny())) + .Callback(() => + { + _mockTestHostManager.Raise(t => t.HostLaunched += null, new HostProviderEventArgs(string.Empty)); + _mockTestHostManager.Raise(t => t.HostExited += null, new HostProviderEventArgs(stdError)); + }) + .Returns(Task.FromResult(true)); + + _mockRequestSender.Setup(rs => rs.WaitForRequestHandlerConnection(It.IsAny(), It.IsAny())).Returns(false); + + var operationManager = new TestableProxyOperationManager(_mockRequestData.Object, _mockRequestSender.Object, _mockTestHostManager.Object); + + Assert.ThrowsExactly(() => operationManager.SetupChannel(["test.dll"], DefaultRunSettings)); + + // Verify OnClientProcessExit was called with the crash context containing both path and error. + _mockRequestSender.Verify( + rs => rs.OnClientProcessExit(It.Is(s => s.Contains(processPath) && s.Contains(stdError))), + Times.Once); + } + + [TestMethod] + public void SetupChannelShouldIncludeProcessPathInErrorWhenTestHostExitsWithOnlyPath() + { + var processPath = @"C:\testhost.exe"; + + _mockTestHostManager.Setup( + m => m.GetTestHostProcessStartInfo( + It.IsAny>(), + It.IsAny>(), + It.IsAny())) + .Returns(new TestProcessStartInfo { FileName = processPath }); + + _mockTestHostManager.Setup(tmh => tmh.LaunchTestHostAsync(It.IsAny(), It.IsAny())) + .Callback(() => + { + _mockTestHostManager.Raise(t => t.HostLaunched += null, new HostProviderEventArgs(string.Empty)); + // Host exits with empty stderr (no error output). + _mockTestHostManager.Raise(t => t.HostExited += null, new HostProviderEventArgs(string.Empty)); + }) + .Returns(Task.FromResult(true)); + + _mockRequestSender.Setup(rs => rs.WaitForRequestHandlerConnection(It.IsAny(), It.IsAny())).Returns(false); + + var operationManager = new TestableProxyOperationManager(_mockRequestData.Object, _mockRequestSender.Object, _mockTestHostManager.Object); + + var ex = Assert.ThrowsExactly(() => operationManager.SetupChannel(["test.dll"], DefaultRunSettings)); + // ThrowOnTestHostExited fires first; with no stderr the crash context is just the path. + Assert.Contains(processPath, ex.Message); + } + private void SetupWaitForTestHostExit() { // Raise host exited when end session is called From da05c88e795c400380f0f3131f6375f8f8bfabbb Mon Sep 17 00:00:00 2001 From: Azat Mukhametshin Date: Thu, 11 Jun 2026 17:27:13 +0200 Subject: [PATCH 5/7] attempt to fix pipeline: tests update --- .../TranslationLayerTests/RunTests.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/RunTests.cs b/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/RunTests.cs index 3aae29ea6d..5e394623b2 100644 --- a/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/RunTests.cs +++ b/test/Microsoft.TestPlatform.Library.IntegrationTests/TranslationLayerTests/RunTests.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; @@ -186,8 +187,8 @@ public void RunTestsShouldThrowOnStackOverflowException(RunnerInfo runnerInfo) _runEventHandler); var errorMessagePattern = runnerInfo.IsNetFrameworkTarget - ? $"The active test run was aborted. Reason: Test host process crashed : Process is terminated due to StackOverflowException.*" - : $"The active test run was aborted. Reason: Test host process crashed : Stack overflow.*"; + ? $"The active test run was aborted. Reason: Test host process crashed : Process path: *{Environment.NewLine}Process is terminated due to StackOverflowException.*" + : $"The active test run was aborted. Reason: Test host process crashed : Process path: *{Environment.NewLine}Stack overflow.*"; _runEventHandler.Errors.Should().ContainSingle() .Which.Should().Match(errorMessagePattern); From 9265d38c9d71412d3710ead1e98172c20dee3bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 11 Jun 2026 18:37:33 +0200 Subject: [PATCH 6/7] fix: update test assertions to match new 'Process path:' error format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ExecutionTests.cs: StackOverflowExceptionShouldBeLoggedToConsoleAndDiagLogFile checked for 'Test host process crashed : Stack overflow.' but the new format is 'Test host process crashed : Process path: \r\nStack overflow.' so the substring no longer matches. Changed to just 'Stack overflow.' which is a stable substring in both formats. ProxyOperationManagerTests.cs: Assert.DoesNotContain arguments were reversed in SetupChannelShouldIncludeOnlyStdErrorWhenProcessPathIsNull — corrected to Assert.DoesNotContain("Process path:", ex.Message). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../ExecutionTests.cs | 2 +- .../Client/ProxyOperationManagerTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ExecutionTests.cs b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ExecutionTests.cs index c70fe7796a..4fd4b85bb4 100644 --- a/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ExecutionTests.cs +++ b/test/Microsoft.TestPlatform.Acceptance.IntegrationTests/ExecutionTests.cs @@ -188,7 +188,7 @@ public void StackOverflowExceptionShouldBeLoggedToConsoleAndDiagLogFile(RunnerIn var errorMessage = "Process is terminated due to StackOverflowException."; if (runnerInfo.IsNetTarget) { - errorMessage = "Test host process crashed : Stack overflow."; + errorMessage = "Stack overflow."; } ExitCodeEquals(1); diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs index 0e44873789..1e5c2b1dc1 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs @@ -498,7 +498,7 @@ public void SetupChannelShouldIncludeOnlyStdErrorWhenProcessPathIsNull() var ex = Assert.ThrowsExactly(() => operationManager.SetupChannel(["test.dll"], DefaultRunSettings)); Assert.Contains(stdError, ex.Message); - Assert.DoesNotContain(ex.Message, "Process path:"); + Assert.DoesNotContain("Process path:", ex.Message); } [TestMethod] From 6e50b54203abf2f4f28d53a403095986568d36f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 11 Jun 2026 19:14:37 +0200 Subject: [PATCH 7/7] fix: add missing space separator before 'Process path:' in timeout message The refactor to use BuildCrashErrorContext dropped the leading space, causing the timeout message and the path addendum to be concatenated without a separator. Restore the space and strengthen the test assertion to check for the separator as well. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Client/ProxyOperationManager.cs | 2 +- .../Client/ProxyOperationManagerTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs index ef5ce17b32..b110b774d4 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/Client/ProxyOperationManager.cs @@ -561,7 +561,7 @@ private void ThrowExceptionOnConnectionFailure(IEnumerable sources, int else if (!StringUtils.IsNullOrWhiteSpace(_testHostProcessFileName)) { // Process launched but no stderr — append path as a diagnostic addendum without overwriting the timeout message. - errorMsg += BuildCrashErrorContext(_testHostProcessFileName, null); + errorMsg += $" {BuildCrashErrorContext(_testHostProcessFileName, null)}"; } throw new TestPlatformException(errorMsg); diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs index 1e5c2b1dc1..227a73d05f 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Client/ProxyOperationManagerTests.cs @@ -522,7 +522,7 @@ public void SetupChannelShouldIncludeProcessPathWhenTestHostTimesOutWithNoStdErr var operationManager = new TestableProxyOperationManager(_mockRequestData.Object, _mockRequestSender.Object, _mockTestHostManager.Object); var ex = Assert.ThrowsExactly(() => operationManager.SetupChannel(["test.dll"], DefaultRunSettings)); - Assert.Contains($"Process path: {processPath}", ex.Message); + Assert.Contains($" Process path: {processPath}", ex.Message); } [TestMethod]