-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix browser not stop during aborts (e.g. SIGTERM) #1420
Commits on Sep 11, 2024
-
This helps us by clarifying that this is a background context, and not controlled by k6 (i.e. the VU context). The background context is to only be used to control the lifecycle of chromium/connection. In later commits vu context will be reintroduced to control the iteration lifecycle so that k6 can abort the iteration and the browser module doesn't block that from happening.
Configuration menu - View commit details
-
Copy full SHA for 83f5247 - Browse repository at this point
Copy the full SHA 83f5247View commit details -
The background context will be used for the chromium subprocess, connection and things that need to be controlled by the iterStart and iterEnd (k6 event system) events. The k6Ctx is the context that is controlled by the vu context. This will allow the iteration to abort due to a SIGTERM while also allowing chromium to exit with endIter/exit events. At the moment this only introduces the k6Ctx, but it is still the background context.
Configuration menu - View commit details
-
Copy full SHA for d52f7f4 - Browse repository at this point
Copy the full SHA d52f7f4View commit details -
vuCtx is a clearer name which represents the VU context.
Configuration menu - View commit details
-
Copy full SHA for 4717c55 - Browse repository at this point
Copy the full SHA 4717c55View commit details -
Now that Browser is setup to work with the different contexts, let's actually set them up correctly.
Configuration menu - View commit details
-
Copy full SHA for 7eadd37 - Browse repository at this point
Copy the full SHA 7eadd37View commit details -
Rename cancelFn to vuCtxCancelFn
This rename makes it clearer which context will be cancelled if the function is called.
Configuration menu - View commit details
-
Copy full SHA for 31bc129 - Browse repository at this point
Copy the full SHA 31bc129View commit details -
Configuration menu - View commit details
-
Copy full SHA for 297daf6 - Browse repository at this point
Copy the full SHA 297daf6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6138c98 - Browse repository at this point
Copy the full SHA 6138c98View commit details -
Configuration menu - View commit details
-
Copy full SHA for 600d028 - Browse repository at this point
Copy the full SHA 600d028View commit details -
Remove background context from module and reg
The background context isn't needed here. We're removing it to make things clearer later on when we get to creating the Browser type, which uses the cu context.
Configuration menu - View commit details
-
Copy full SHA for 951be75 - Browse repository at this point
Copy the full SHA 951be75View commit details -
Configuration menu - View commit details
-
Copy full SHA for e439161 - Browse repository at this point
Copy the full SHA e439161View commit details -
Configuration menu - View commit details
-
Copy full SHA for c9734fe - Browse repository at this point
Copy the full SHA c9734feView commit details -
Configuration menu - View commit details
-
Copy full SHA for 704e466 - Browse repository at this point
Copy the full SHA 704e466View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5024e4e - Browse repository at this point
Copy the full SHA 5024e4eView commit details -
Add a cancellable context to Browser init go
It didn't feel right having a goroutine where there was no way of shutting it down. Now when the browser.Close() method is called it will shut the init goroutine down too.
Configuration menu - View commit details
-
Copy full SHA for dbac2f9 - Browse repository at this point
Copy the full SHA dbac2f9View commit details
Commits on Sep 12, 2024
-
Update the comments on context background
This is to ensure that we remember why we're using context.Background for launching or connecting to chromium.
Configuration menu - View commit details
-
Copy full SHA for b52ef8a - Browse repository at this point
Copy the full SHA b52ef8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 41ad3e0 - Browse repository at this point
Copy the full SHA 41ad3e0View commit details -
Encapsulate the retrieval of the browser count from the registry.
Configuration menu - View commit details
-
Copy full SHA for f371941 - Browse repository at this point
Copy the full SHA f371941View commit details -
Encapsulate the retrieval of the iteration trace count from the registry.
Configuration menu - View commit details
-
Copy full SHA for ac2df75 - Browse repository at this point
Copy the full SHA ac2df75View commit details -
Rename getIterationTracesCount & getBrowserCount
To be more idiomatic go
Configuration menu - View commit details
-
Copy full SHA for 89bcc73 - Browse repository at this point
Copy the full SHA 89bcc73View commit details