Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

GC browser processes #93

Closed
robingustafsson opened this issue Nov 12, 2021 · 1 comment · Fixed by #110
Closed

GC browser processes #93

robingustafsson opened this issue Nov 12, 2021 · 1 comment · Fixed by #110
Assignees
Labels
bug Something isn't working idea 💡

Comments

@robingustafsson
Copy link
Member

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:

  • We now have k6Throw() in helpers.go, perhaps we should extend it to cleanup any running browser processes before calling panic() via some sort of context-attached hook.
  • Implement hooks in k6 for extensions to be notified when an iteration, VU, scenario or test ends, so that the extension can do necessary cleanup actions.
@robingustafsson robingustafsson added idea 💡 bug Something isn't working labels Nov 12, 2021
@inancgumus
Copy link
Member

inancgumus commented Nov 12, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working idea 💡
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants