-
Notifications
You must be signed in to change notification settings - Fork 39
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
Enable multiple k6-browser instances to run concurrent tests against a single browser #848
Commits on Apr 5, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 2377503 - Browse repository at this point
Copy the full SHA 2377503View commit details -
This makes it easy to check if a session is closed from a non-select statement, like a switch or if.
Configuration menu - View commit details
-
Copy full SHA for c348332 - Browse repository at this point
Copy the full SHA c348332View commit details -
Fix panic: GoError: creating a new page: canceled
When we run multi-VU/instance tests, one of the test runs can close a page of its own. Since each test run attaches to all the browser pages (this is another area we might want to discuss), this sometimes creates a race between the test runs. This check allows the test run to continue instead of panicking because of another test run's page detachments. This fix allows running the k6 browser in high concurrency with multiple VUs and instances. Note that it is still possible to get errors since we need to correctly handle the CDP messages while sending and receiving them (the order of them). This can cause timeout and other sorts of errors. Explanation: There are two instances and different sessions. However, both instances attach/detach from the same pages since we run in the same browser. instance1 ---> newPage page1 attaches to: page1 instance2 attaches to: page1 instance2 ---> newPage page1, page2 attaches to: page2 instance1 attaches to: page2 instance1 --> page1.Close() page2 instance1 <-- detachedFromTarget(page1) closes page1 session. This is the racy part that this PR fixes: instance2 <-- detachedFromTarget(page1) closes page1 session. instance2 ---> attachToTarget(page1) panic: session does not exist. instance2 panics while trying to send CDP messages to a closed web socket connection since it detaches from it and tries to attach to it concurrently.
Configuration menu - View commit details
-
Copy full SHA for 8b919fd - Browse repository at this point
Copy the full SHA 8b919fdView commit details -
Add testBrowser.browserType field
This is for connecting to an existing browser over a WebSocket URL.
Configuration menu - View commit details
-
Copy full SHA for 1bef29e - Browse repository at this point
Copy the full SHA 1bef29eView commit details -
Add TestMultiConnectToSingleBrowser
This will panic if the fix in this PR did not get applied. Since the panic occurs in a different routine, we can't catch the panic, and leave this test as naked (without using require.Panics).
Configuration menu - View commit details
-
Copy full SHA for 47567fc - Browse repository at this point
Copy the full SHA 47567fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a167e7 - Browse repository at this point
Copy the full SHA 1a167e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for d649616 - Browse repository at this point
Copy the full SHA d649616View commit details -
Simplify var declaration in onAttachedToTarget
Also move the log to top.
Configuration menu - View commit details
-
Copy full SHA for ed2a3d2 - Browse repository at this point
Copy the full SHA ed2a3d2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 34a0be1 - Browse repository at this point
Copy the full SHA 34a0be1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f43f23 - Browse repository at this point
Copy the full SHA 3f43f23View commit details -
Configuration menu - View commit details
-
Copy full SHA for abe212d - Browse repository at this point
Copy the full SHA abe212dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a3c000 - Browse repository at this point
Copy the full SHA 3a3c000View commit details -
Configuration menu - View commit details
-
Copy full SHA for b5b5204 - Browse repository at this point
Copy the full SHA b5b5204View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b2ae23 - Browse repository at this point
Copy the full SHA 5b2ae23View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b2a2fc - Browse repository at this point
Copy the full SHA 1b2a2fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 406d2c6 - Browse repository at this point
Copy the full SHA 406d2c6View commit details
Commits on Apr 6, 2023
-
Fix log categories in page attachment
Also move one logging out of locking. Co-authored-by: ankur22 <ankur.agarwal@grafana.com>
Configuration menu - View commit details
-
Copy full SHA for 745cf54 - Browse repository at this point
Copy the full SHA 745cf54View commit details