-
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
Timeout launching browser installed as a Snap package #4425
Comments
Update and correction: After discussions with Ankur, we determined that the issue mentioned in the description happens in WSL2/Ubuntu because the This issue was also seen on Linux, but only on Cloud test runs. See grafana/xk6-browser#559. It makes sense, since both EC2 and WSL2 run Linux VMs. I haven't been able to reproduce it natively on my local machine, and it's very rare even in the Cloud, but if it can be consistently reproduced in WSL2, that might be a good testbed for troubleshooting this. The error is:
It's the same error, just friendlier since we don't mention the context anymore. As mentioned in grafana/xk6-browser#559:
|
This is slightly more elegant than parsing stdout, but more importantly, shouldn't cause race conditions where we miss the "DevTools listening on" line, since it doesn't start a goroutine. A drawback is that it could take slightly longer to return the URL because it's reading from disk and does several read attempts with delays, but in my tests the difference is negligible. In total, it allots 500ms to read the file, which should hopefully be plenty even on IO-starved machines (VMs, CI, etc.). IMO if this takes more time than that then it's likely the environment will not be fit for running a test. Fixes #491
Given that we now know the root cause of this (see the updated comment above), the fix for this issue should ensure that we fail quickly, and, if possible, printing an informative error that mentions that only native binaries are supported (or maybe printing the process' stderr?). Checking the behavior on Ubuntu 20.04, And maybe part of this issue, but we should clarify in our README and documentation that Snap/Flatpak and any other way of running the browser inside a container, is not supported. We should specifically mention Ubuntu, as most people are likely unaware that the |
@grafana/k6-browser Is this still relevant? |
Needs to be evaluated. |
Original community forum post: https://community.k6.io/t/xk6-browser-error-getting-devtools-url-context-deadline-exceeded/4410
xk6-browser version: https://github.com/grafana/xk6-browser/releases/tag/v0.4.0
Platform: Windows 11, WSL2, Ubuntu 20.04
Issue
The user reported that they were unable to run the example that was posted in this blog post. They were able to install and compile a binary using the commands that were in the blog post, but when it came to running the example test, the test times out and fails with:
I was able to reproduce the issue on my Windows laptop.
The text was updated successfully, but these errors were encountered: