Skip to content

k6/Browser Shared Worker support? #4705

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

Open
camanderson opened this issue Apr 17, 2025 · 0 comments
Open

k6/Browser Shared Worker support? #4705

camanderson opened this issue Apr 17, 2025 · 0 comments

Comments

@camanderson
Copy link

Brief summary

I have a large NodeJS MFE webpage that relies on a shared worker to validate auth before allowing the user into the landing page. When attempting to setup k6/browser perf tests for our application, I have been able to successfully navigate to the webpage, automatically get redirected to the auth flow, k6 is able to automate the auth inputs to complete the auth flow, get redirected back to the desired webpage, but then gets hung up waiting for the shared worker to validate the authentication.

I am able to confirm the hangup is due to the shared worker because if I am actively inspecting the worker through chrome://inspect/#workers and open the sso-worker's DevTools inspect page, when I reload the webpage, everything works as expected.

Overall, I am wondering if shared workers have no support or compatibility with k6/browser currently, the docs have no reference to them so I cannot confirm one way or the other. We are able to fully e2e test our application through Playwright with no loading issues related to our shared worker. We are very unsure what could be causing this hangup because everything LOOKS like it is a regular Chrome session.

k6 version

k6 v1.0.0-rc1 (go1.24.1, darwin/arm64)

OS

macOS 15.3.2

Docker version and image (if applicable)

No response

Steps to reproduce the problem

Working on creating a MVP repo to replicate the issue, in the meantime these are the steps I have taken on a setup I cannot share:

  • Created a browser context + new page in a k6.js script
  • Navigate to my webpage, programmatically complete the auth workflow
  • Get stuck on loading screen after auth
  • Open a new tab and navigate to chrome://inspect/#workers and open the DevTools inspect for the shared worker
  • Reload webpage, this will force the auth flow again because the worker had no context of the original auth
  • Complete auth flow and hit the landing page as expected, while never closing the shared worker's DevTools inspect window

Expected behaviour

  • Navigate to webpage, redirect to auth, complete auth workflow, redirect back to webpage, fully load landing page with no hangup.

Actual behaviour

  • Navigate to webpage, redirect to auth, complete auth workflow, redirect back to webpage, hang on loading screen because shared worker does not seem to be fully initialized/operable in unless I manually inspect it.
@camanderson camanderson changed the title Shared Worker support?? k6/Browser Shared Worker support? Apr 17, 2025
@inancgumus inancgumus removed their assignment Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants