This repository has been archived by the owner on Jan 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inancgumus
approved these changes
Sep 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks! Before merging, should we wait for the k6 side of the fix?
Yep, good idea. I can then update k6 in this PR with the fix. Done in 1095480 |
675d409
to
aa6a1c0
Compare
ankur22
commented
Sep 25, 2024
Use the existing background context instead of creating a new one.
Use the existing background context instead of creating a new one.
Since the context that is used is a essentially a background context, we need to have a timeout in place. There is a chance that the browser process has already exited but the connection thinks it is still alive. By using the timeout we're ensuring that the iteration can end, which allows for the events to be emitted by the k6 event system and so allow k6 to exit in a timely manner.
Working with c.ctx will essentially never end since it is basically a background context. Using the passed in context which has a timeout will help ensure the send goroutine ends quickly.
The PR we're interested in is grafana/k6#3968.
aa6a1c0
to
b4b16ba
Compare
inancgumus
approved these changes
Sep 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reapproving :)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
We're putting a timeout on the CDP close request.
Why?
This is so that the connection is closed and we allow the iteration to end. Without this, the browser module can be left hanging indefinitely on the cdp send (well, waiting for the response from chromium) when actually chromium has already exited.
Checklist
Related PR(s)/Issue(s)
Updates: #1440