File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/libraries/System.Net.Http/tests/StressTests/HttpStress Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -244,12 +244,20 @@ private static async Task<ExitCode> Run(Configuration config)
244244 }
245245
246246 // return nonzero status code if there are stress errors
247- return client ? . TotalErrorCount == 0 ? ExitCode . Success : ExitCode . StressError ;
247+ return client ? . TotalErrorCount == 0 && s_unobservedExceptions . Count == 0 ? ExitCode . Success : ExitCode . StressError ;
248248 }
249249
250250 private static void PrintUnobservedExceptions ( )
251251 {
252+ if ( s_unobservedExceptions . Count == 0 )
253+ {
254+ Console . WriteLine ( "No unobserved exceptions detected." ) ;
255+ return ;
256+ }
257+
258+ Console . ForegroundColor = ConsoleColor . DarkRed ;
252259 Console . WriteLine ( $ "Detected { s_unobservedExceptions . Count } unobserved exceptions:") ;
260+ Console . ResetColor ( ) ;
253261
254262 int i = 1 ;
255263 foreach ( KeyValuePair < string , int > kv in s_unobservedExceptions . OrderByDescending ( p => p . Value ) )
You can’t perform that action at this time.
0 commit comments