File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,6 +209,10 @@ async function startManagedExternalWebServer({
209209 await lifecycle . markPid ( child . pid ?? null ) ;
210210 child . stdout ?. pipe ( stdout ) ;
211211 child . stderr ?. pipe ( stderr ) ;
212+ const childOutputStreamsFinished = Promise . all ( [
213+ child . stdout ? finished ( child . stdout ) . catch ( ( ) => { } ) : Promise . resolve ( ) ,
214+ child . stderr ? finished ( child . stderr ) . catch ( ( ) => { } ) : Promise . resolve ( ) ,
215+ ] ) ;
212216 const logStreamsFinished = Promise . all ( [
213217 finished ( stdout ) . catch ( ( ) => { } ) ,
214218 finished ( stderr ) . catch ( ( ) => { } ) ,
@@ -269,6 +273,7 @@ async function startManagedExternalWebServer({
269273 await exitPersistPromise ;
270274 await lifecycle . waitForPendingWrites ( ) ;
271275 if ( child . exitCode != null || child . signalCode != null ) {
276+ await childOutputStreamsFinished ;
272277 await logStreamsFinished ;
273278 }
274279 throw error ;
You can’t perform that action at this time.
0 commit comments