grafana / xk6-browser

The browser module adds support for browser automation and end-to-end web testing via the Chrome Devtools Protocol to k6.
https://grafana.com/docs/k6/latest/javascript-api/k6-browser/
GNU Affero General Public License v3.0
344 stars 41 forks source link

Fix write channel to exit when ctx is done #1438

Closed ankur22 closed 2 months ago

ankur22 commented 2 months ago

What?

Ensuring that the goroutine can exit early if the context is closed.

Why?

There's a chance that the goroutine reading off the resultCh has or is exiting due to the context being closed. We don't want this goroutine to be hanging around waiting since nothing will read off the resultCh or errCh.

Checklist

Related PR(s)/Issue(s)

Updates: https://github.com/grafana/xk6-browser/issues/1437