From fd327b6da7a4fa9e86889cc529def80a281e03c5 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 5 Jul 2023 12:58:18 -0700 Subject: [PATCH] Ensure both failed tests and errors cancel for stopOnFail --- Versions.props | 2 +- src/xunit.runner.visualstudio/VsTestRunner.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Versions.props b/Versions.props index de5ecb38..cfc07dbd 100644 --- a/Versions.props +++ b/Versions.props @@ -9,7 +9,7 @@ 5.0.0 1.0.0-alpha.160 1.2.0-pre.48 - 2.5.0-pre.44 + 2.5.0-pre.45 diff --git a/src/xunit.runner.visualstudio/VsTestRunner.cs b/src/xunit.runner.visualstudio/VsTestRunner.cs index af05cc75..79916612 100644 --- a/src/xunit.runner.visualstudio/VsTestRunner.cs +++ b/src/xunit.runner.visualstudio/VsTestRunner.cs @@ -578,7 +578,7 @@ void RunTestsInAssembly( resultsSink.Finished.WaitOne(); reporterMessageHandler.OnMessage(new TestAssemblyExecutionFinished(assembly, executionOptions, resultsSink.ExecutionSummary)); - if (resultsSink.ExecutionSummary.Failed != 0 && executionOptions.GetStopOnTestFailOrDefault()) + if ((resultsSink.ExecutionSummary.Failed != 0 || resultsSink.ExecutionSummary.Errors != 0) && executionOptions.GetStopOnTestFailOrDefault()) { logger.Log("Canceling due to test failure..."); cancelled = true;