@@ -37,11 +37,18 @@ Task("_NetFramework_Unit_Tests_WithRetry")
3737 }
3838
3939 testExecutionHelper . RetryFailedXUnitTests (
40- testAssemblies ,
40+ testAssemblies ,
4141 resultsPath ,
4242 testRetryHelper ,
4343 ( test ) => testExecutionHelper . CreateXUnitSettings ( "retry" , isIntegration : false , isRetry : true )
4444 ) ;
45+
46+ // Check if any tests still failed after retry
47+ var stillFailedTests = testRetryHelper . FindFailedXUnitTests ( resultsPath ) ;
48+ if ( stillFailedTests . Any ( ) )
49+ {
50+ throw new Exception ( $ "{ stillFailedTests . Count } test(s) failed after retry") ;
51+ }
4552} ) ;
4653
4754Task ( "_NetFramework_Integration_Tests" )
@@ -79,11 +86,18 @@ Task("_NetFramework_Integration_Tests_WithRetry")
7986 }
8087
8188 testExecutionHelper . RetryFailedXUnitTests (
82- testAssemblies ,
89+ testAssemblies ,
8390 resultsPath ,
8491 testRetryHelper ,
8592 ( test ) => testExecutionHelper . CreateXUnitSettings ( "retry" , isIntegration : true , isRetry : true )
8693 ) ;
94+
95+ // Check if any tests still failed after retry
96+ var stillFailedTests = testRetryHelper . FindFailedXUnitTests ( resultsPath ) ;
97+ if ( stillFailedTests . Any ( ) )
98+ {
99+ throw new Exception ( $ "{ stillFailedTests . Count } test(s) failed after retry") ;
100+ }
87101} ) ;
88102
89103///////////////////////////////////////////////////////////////////////////////
@@ -127,6 +141,13 @@ Task("_NetStandard_Unit_Tests_WithRetry")
127141 }
128142
129143 testExecutionHelper . RetryFailedDotNetTests ( project , resultsPath , testRetryHelper , framework , configuration ) ;
144+
145+ // Check if any tests still failed after retry
146+ var stillFailedTests = testRetryHelper . FindFailedDotNetTests ( resultsPath ) ;
147+ if ( stillFailedTests . Any ( ) )
148+ {
149+ throw new Exception ( $ "{ stillFailedTests . Count } test(s) failed after retry") ;
150+ }
130151} ) ;
131152
132153Task ( "_NetStandard_Integration_Tests" )
@@ -166,6 +187,13 @@ Task("_NetStandard_Integration_Tests_WithRetry")
166187 }
167188
168189 testExecutionHelper . RetryFailedDotNetTests ( project , resultsPath , testRetryHelper , framework , configuration ) ;
190+
191+ // Check if any tests still failed after retry
192+ var stillFailedTests = testRetryHelper . FindFailedDotNetTests ( resultsPath ) ;
193+ if ( stillFailedTests . Any ( ) )
194+ {
195+ throw new Exception ( $ "{ stillFailedTests . Count } test(s) failed after retry") ;
196+ }
169197} ) ;
170198
171199///////////////////////////////////////////////////////////////////////////////
0 commit comments