File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,11 +141,6 @@ impl CommandService {
141141 return Ok ( ( ) ) ;
142142 }
143143
144- if self . command_line_args . exit_on_error && self . context . command_metrics . error_occurred ( ) {
145- trace ! ( "return from spawn_command due to exit_on_error" ) ;
146- return Ok ( ( ) ) ;
147- }
148-
149144 let context_clone = Arc :: clone ( & self . context ) ;
150145
151146 let output_sender = self . output_writer . sender ( ) ;
@@ -155,6 +150,11 @@ impl CommandService {
155150 . await
156151 . context ( "command_semaphore.acquire_owned error" ) ?;
157152
153+ if self . command_line_args . exit_on_error && self . context . command_metrics . error_occurred ( ) {
154+ trace ! ( "return from spawn_command due to exit_on_error" ) ;
155+ return Ok ( ( ) ) ;
156+ }
157+
158158 tokio:: spawn ( async move {
159159 command. run ( & context_clone, output_sender) . await ;
160160
Original file line number Diff line number Diff line change @@ -603,7 +603,7 @@ fn test_exit_status_on_failing_commands_exit_on_error() {
603603 . failure ( )
604604 . code ( 1 )
605605 . stdout (
606- ( predicate:: str:: contains ( "command failed" ) )
606+ ( predicate:: str:: contains ( "command failed" ) . count ( 1 ) )
607607 . and ( predicate:: str:: contains ( "command failures:" ) )
608608 . and ( predicate:: str:: contains ( "exit_status_errors=0" ) . not ( ) ) ,
609609 )
You can’t perform that action at this time.
0 commit comments