Skip to content

Commit

Permalink
fix: wait for logs to collect before exiting runner
Browse files Browse the repository at this point in the history
  • Loading branch information
connerdouglass committed Apr 27, 2024
1 parent 919fd17 commit 45fed99
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,13 @@ func (p *implRunner) Run(ctx context.Context) error {
}

// Wait for the process to end
if err := cmd.Wait(); err != nil {
// Wait for the error log to finish
wg.Wait()
err = cmd.Wait()

// Wait for the error log to finish
wg.Wait()

// If the process errored, return the error
if err != nil {
// If the context triggered the process to be killed, we want to see the context's error
// instead of the process's error
if ctx != nil && ctx.Err() != nil {
Expand Down

0 comments on commit 45fed99

Please sign in to comment.