From 3287d5c2dc7dda1bf09658f01329f39de2208542 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Mon, 13 Aug 2018 14:51:47 -0700 Subject: [PATCH] workaround xunit test crash on VSTS --- build.psm1 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index 44ddfa639d1..668e3beeb4a 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1513,7 +1513,20 @@ function Start-PSxUnit { # Run sequential tests first, and then run the tests that can execute in parallel dotnet xunit -configuration $Options.configuration -xml $SequentialTestResultsFile -namespace "PSTests.Sequential" -parallel none - dotnet xunit -configuration $Options.configuration -xml $ParallelTestResultsFile -namespace "PSTests.Parallel" -nobuild + $extraParams = @() + + # we are having intermittent issues on macOS with these tests failing. + # VSTS has suggested forcing them to be sequential + if($env:TF_BUILD -and $IsMacOS) + { + Write-Log 'Forcing parallel xunit tests to run sequentially.' + $extraParams += @( + '-parallel' + 'none' + ) + } + + dotnet xunit -configuration $Options.configuration -xml $ParallelTestResultsFile -namespace "PSTests.Parallel" -nobuild @extraParams } finally { Pop-Location