Closed robingustafsson closed 2 years ago
We can temporarily do something to fix this problem in k6Throw
, but I think we need the second solution from the k6 side the best: notifying the extension just before an iteration, VU, scenario, or test ends.
Throughout the development of xk6-browser there's been many times when the browser process or processes have not been properly terminated when k6 exits. Most of the time it's related to k6
panic()
'ing but there's also been situations where the orderly closing of the browser hasn't worked properly.We need to find a way to avoid ever having orphaned browser processes when k6 exits (find a way to get the equivalent of cross-platform
cmd.SysProcAttr.Pdeathsig = syscall.SIGKILL
). Some ideas:k6Throw()
in helpers.go, perhaps we should extend it to cleanup any running browser processes before callingpanic()
via some sort of context-attached hook.