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)
244
244
}
245
245
246
246
// 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 ;
248
248
}
249
249
250
250
private static void PrintUnobservedExceptions ( )
251
251
{
252
+ if ( s_unobservedExceptions . Count == 0 )
253
+ {
254
+ Console . WriteLine ( "No unobserved exceptions detected." ) ;
255
+ return ;
256
+ }
257
+
258
+ Console . ForegroundColor = ConsoleColor . DarkRed ;
252
259
Console . WriteLine ( $ "Detected { s_unobservedExceptions . Count } unobserved exceptions:") ;
260
+ Console . ResetColor ( ) ;
253
261
254
262
int i = 1 ;
255
263
foreach ( KeyValuePair < string , int > kv in s_unobservedExceptions . OrderByDescending ( p => p . Value ) )
You can’t perform that action at this time.
0 commit comments