Skip to content

Commit

Permalink
Fix panic process close in FindProcess
Browse files Browse the repository at this point in the history
The current code returns when it can't find a process with PID, instead
of trying to kill the rest. This PR fixes that sneaky bug.
  • Loading branch information
inancgumus committed Mar 17, 2023
1 parent 6651aa8 commit bbb958a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions k6ext/panic.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ func sharedPanic(ctx context.Context, failFunc func(rt *goja.Runtime, a ...any),
for _, pid := range pidder.Pids() {
p, err := os.FindProcess(pid)
if err != nil {
// optimistically return and don't kill the process
return
// optimistically skip and don't kill the process
continue
}
// no need to check the error for whether we could kill it as
// we're already dying.
Expand Down

0 comments on commit bbb958a

Please sign in to comment.