@@ -575,11 +575,17 @@ const waitForRelayer = async (deps: RuntimeDeps) => {
575575
576576const resetAfterStep = async ( step : StepName , deps : RuntimeDeps ) => {
577577 const start = stateStepIndex ( step ) ;
578+ const failed : string [ ] = [ ] ;
578579 for ( let index = STEP_NAMES . length - 1 ; index >= start ; index -= 1 ) {
579580 for ( const component of COMPONENT_BY_STEP [ STEP_NAMES [ index ] ] ) {
580- await composeDown ( component , deps ) ;
581+ if ( ! ( await composeDown ( component , deps ) ) ) {
582+ failed . push ( component ) ;
583+ }
581584 }
582585 }
586+ if ( failed . length ) {
587+ throw new Error ( `Failed to stop components while resetting from ${ step } : ${ failed . join ( ", " ) } ` ) ;
588+ }
583589} ;
584590
585591const ensureRuntimeArtifacts = async ( state : State , deps : Pick < RuntimeDeps , "runner" > , reason : string ) => {
@@ -1072,17 +1078,23 @@ const runDown = async (deps: RuntimeDeps) => {
10721078 await ensureRuntimeArtifacts ( state , deps , "teardown" ) ;
10731079 }
10741080 let stopped = false ;
1081+ const failed : string [ ] = [ ] ;
10751082 for ( const component of [ ...COMPONENTS ] . reverse ( ) ) {
10761083 if ( ! ( await exists ( composePath ( component ) ) ) ) {
10771084 continue ;
10781085 }
10791086 stopped = true ;
10801087 log ( `[down] ${ component } ` ) ;
1081- await composeDown ( component , deps ) ;
1088+ if ( ! ( await composeDown ( component , deps ) ) ) {
1089+ failed . push ( component ) ;
1090+ }
10821091 }
10831092 if ( ! stopped ) {
10841093 log ( "[down] nothing to stop" ) ;
10851094 }
1095+ if ( failed . length ) {
1096+ throw new Error ( `Failed to stop components: ${ failed . join ( ", " ) } ` ) ;
1097+ }
10861098} ;
10871099
10881100const runStatus = async ( deps : RuntimeDeps ) => {
0 commit comments