-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Expose a new browser
specific option in scenarios
#3022
Comments
@ankur22 I have a few questions about this feature.
|
Hey @imiric ! I will try to answer your questions:
Our initial approach is that the lifetime of the
To be honest I lack some context to really give an opinion here. For the case of k6 browser I believe it wont' change much, but I think this "intermediate" What is your take on @imiric 's proposal @na-- ?
Our initial idea was to use |
Thanks for answering @ka3de! 🙇 I already discussed this last week with @ankur22 on Slack, so we're aligned on the way forward. Sorry for not updating this issue after the discussion. See #3036 for a preliminary change for this. I decided to keep the nested |
Ok! I was not aware 😅 Saw the commit but was not sure if still these questions required clarification. Perfect then! 👍 |
Thanks for answering @ka3de. I was meant to post the answers after the discussion. |
Feature Description
How we currently work with the
browserType
andbrowser
With the
k6-browser
module we currently have to be very explicit in how we define and create thebrowser
object (which starts and connects to the browser instance), which we now feel isn't a great DX. We also allow any number of browsers to be launched, which we think is a feature that isn't particularly useful. Each iteration will start and stop a browser process, which we think is wasteful since running browser instances is an expensive process.In general we want to be able to abstract away the lifecycle of running the browser, and at the same time reduce the number of browser instances a test run needs to work with.
Suggested Solution (optional)
We think the solution is for the k6-browser module (or an external process) to take ownership of the browser instances lifecycle depending on a heuristic that it sees fit for the test requirements. For the module/process to determine how many browser instances it requires, we want to leverage
scenarios
which will help us determine how many vus a test run will need. The k6-browser module will restrict the number ofbrowserContexts
to one per vu per iteration. So in the following example where we have defined onescenario
, we know that the test will require 10 vus, and the module/process can work with this number to start up a suitable number of browser instances that can be shared between all the iterations.To clarify, the requested change is specifically to add this:
Note that the validation of the properties should be done by the k6-browser module.
Already existing or connected issues / PRs (optional)
No response
The text was updated successfully, but these errors were encountered: