webdriverio/webdriverio
[🐛 Bug]: Connection errors with sauce-service@8.14.5 and above
Aberta
#11.094 aberto em 4 de set. de 2023
Bug 🐛good first pickhelp wanted
Métricas do repositório
- Stars
- (6.029 estrelas)
- Métricas de merge de PR
- (Mesclagem média 15d 15h) (48 fundiu PRs em 30d)
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
8.14.6
Node.js Version
16.4
Mode
Standalone Mode
Which capabilities are you using?
{
browserName: 'chrome',
platformName: 'Windows 11',
browserVersion: 'latest'
}
What happened?
After the update to 8.14.5 and later versions I started to get this error
[0-0] 2023-09-04T17:39:59.041Z ERROR @wdio/runner: Failed to run browser tests with cid 0-0: unknown error: Failed to load test page to run tests, make sure your browser can access "http://localhost:52305"
[0-0] at getErrorFromResponseBody (file:///Users/gkostov/git/test/node_modules/webdriver/build/utils.js:194:12)
[0-0] at NodeJSRequest._request (file:///Users/gkostov/git/test/node_modules/webdriver/build/request/index.js:164:23)
[0-0] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[0-0] at async Browser.wrapCommandFn (file:///Users/gkostov/git/test/node_modules/@wdio/utils/build/shim.js:72:29)
[0-0] at async Browser.wrapCommandFn (file:///Users/gkostov/git/test/node_modules/@wdio/utils/build/shim.js:72:29)
[0-0] at async BrowserFramework.#runSpec (file:///Users/gkostov/git/test/node_modules/@wdio/runner/build/browser.js:75:13)
[0-0] at async BrowserFramework.#loop (file:///Users/gkostov/git/test/node_modules/@wdio/runner/build/browser.js:62:25)
[0-0] at async BrowserFramework.run (file:///Users/gkostov/git/test/node_modules/@wdio/runner/build/browser.js:40:30)
[0-0] at async Runner.run (file:///Users/gkostov/git/test/node_modules/@wdio/runner/build/index.js:146:24)
[0-0] Error: Failed to load test page to run tests, make sure your browser can access "http://localhost:52305"
With earlier versions that url used to contain an IP and not localhost so I'm guessing that this commit may be related https://github.com/webdriverio/webdriverio/commit/6344b3b508938e057d22bd9db898d67aab95d14d
I guess it could be important to note that I'm using the sauceConnect flag.
What is your expected behavior?
The test shall be passing as usual.
How to reproduce the bug.
I have a minimal repo here https://github.com/gkostov/wdio-test which helps to reproduce the error.
Relevant log output
2023-09-04T17:39:19.537Z DEBUG @wdio/sauce-service: Sauce Connect Log: Sauce Connect 4.9.0, build 5583 68133c6
Proxy auto-detection is disabled.
2023-09-04T17:39:19.807Z DEBUG @wdio/sauce-service: Sauce Connect Log: WARNING: Outdated version 4.9.0. Please download the latest version from https://saucelabs.com/downloads/sc-4.9.1-osx.zip
2023-09-04T17:39:19.860Z DEBUG @wdio/sauce-service: Sauce Connect Log: Sauce Connect runtime information:
2023-09-04T17:39:19.860Z DEBUG @wdio/sauce-service: Sauce Connect Log: - Name: SC-tunnel-5171404753875417
- PID: 19121
- PID file: /tmp/sc_client-SC-tunnel-5171404753875417.pid
- Log file: /var/folders/5w/hq09dykx3kxgdq2djp_p1fd40000gn/T/sc-SC-tunnel-5171404753875417.log
- SCProxy Port: 52240
- Status Port: None
- Selenium listener: None
- External proxy: None
2023-09-04T17:39:19.861Z DEBUG @wdio/sauce-service: Sauce Connect Log: - Tunnel proxy: None
- Region: eu-central-1
Please wait for 'you may start your tests' to start your tests
2023-09-04T17:39:29.520Z DEBUG @wdio/sauce-service: Sauce Connect Log: WARNING: The open file limit in your Operating System is too low. Sauce Labs recommends setting it to at least 64000. Please see https://docs.saucelabs.com/secure-connections/sauce-connect/system-requirements/ for more information.
2023-09-04T17:39:29.520Z DEBUG @wdio/sauce-service: Sauce Connect Log:
Secure remote tunnel provisioned. Tunnel ID: 1246e36ef1e840388caa12f185607b19
2023-09-04T17:39:31.819Z DEBUG @wdio/sauce-service: Sauce Connect Log:
2023-09-04T17:39:31.820Z DEBUG @wdio/sauce-service: Sauce Connect Log: Sauce Connect is up, you may start your tests.
2023-09-04T17:39:31.820Z INFO @wdio/sauce-service: Started Sauce Connect Tunnel within 12641.792359001935ms
2023-09-04T17:39:31.820Z DEBUG @wdio/cli:utils: Finished to run "onPrepare" hook in 12644ms
2023-09-04T17:39:31.824Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2023-09-04T17:39:31.824Z DEBUG @wdio/cli:utils: Finished to run "onWorkerStart" hook in 0ms
2023-09-04T17:39:31.853Z INFO @wdio/sauce-service: Sauce Connect successfully started after 12641.792359001935ms
2023-09-04T17:39:31.972Z INFO @wdio/browser-runner:ViteServer: Vite server started successfully on port 52305, root directory: /Users/gkostov/git/test
2023-09-04T17:39:31.974Z INFO @wdio/local-runner: Start worker 0-0 with arg:
2023-09-04T17:39:31.984Z DEBUG @wdio/local-runner: Send command run to worker with cid "0-0"
[0-0] 2023-09-04T17:39:34.183Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2023-09-04T17:39:34.528Z DEBUG @wdio/runner: init remote session
[0-0] 2023-09-04T17:39:34.531Z DEBUG @wdio/utils:initialiseServices: initialise service "sauce" as NPM package
[0-0] 2023-09-04T17:39:34.939Z DEBUG @wdio/utils:shim: Finished to run "beforeSession" hook in 0ms
[0-0] RUNNING in chrome - file:///test/index.js
[0-0] 2023-09-04T17:39:34.999Z DEBUG @wdio/runner: init remote session
[0-0] 2023-09-04T17:39:35.000Z INFO webdriver: Initiate new session using the WebDriver protocol
[0-0] 2023-09-04T17:39:35.000Z INFO webdriver: Connecting to existing driver at https://ondemand.eu-central-1.saucelabs.com:443/wd/hub
[0-0] 2023-09-04T17:39:35.009Z INFO webdriver: [POST] https://ondemand.eu-central-1.saucelabs.com/wd/hub/session
[0-0] 2023-09-04T17:39:35.009Z INFO webdriver: DATA {
[0-0] capabilities: {
[0-0] alwaysMatch: {
[0-0] browserName: 'chrome',
[0-0] platformName: 'Windows 11',
[0-0] browserVersion: 'latest',
[0-0] 'sauce:options': [Object]
[0-0] },
[0-0] firstMatch: [ {} ]
[0-0] },
[0-0] desiredCapabilities: {
[0-0] browserName: 'chrome',
[0-0] platformName: 'Windows 11',
[0-0] browserVersion: 'latest',
[0-0] 'sauce:options': { tunnelIdentifier: 'SC-tunnel-5171404753875417' }
[0-0] }
[0-0] }
[0-0] 2023-09-04T17:39:41.608Z DEBUG @wdio/utils:shim: Finished to run "before" hook in 0ms
[0-0] 2023-09-04T17:39:41.609Z INFO @wdio/runner: Run spec file file:///Users/gkostov/git/test/test/index.js for cid 0-0
[0-0] 2023-09-04T17:39:41.612Z INFO webdriver: COMMAND navigateTo("http://localhost:52305/?cid=0-0&spec=/Users/gkostov/git/test/test/index.js")
[0-0] 2023-09-04T17:39:41.612Z INFO webdriver: [POST] https://ondemand.eu-central-1.saucelabs.com/wd/hub/session/bb84b5d5d1084984a4e7879c4a25eab5/url
[0-0] 2023-09-04T17:39:41.612Z INFO webdriver: DATA {
[0-0] url: 'http://localhost:52305/?cid=0-0&spec=/Users/gkostov/git/test/test/index.js'
[0-0] }
[0-0] 2023-09-04T17:39:46.763Z DEBUG webdriver: request failed due to response error: unknown error
[0-0] 2023-09-04T17:39:46.763Z WARN webdriver: Request failed with status 500 due to unknown error: net::ERR_CONNECTION_REFUSED
[0-0] (Session info: chrome=116.0.5845.97)
[0-0] 2023-09-04T17:39:46.763Z INFO webdriver: Retrying 1/3
[0-0] 2023-09-04T17:39:46.763Z INFO webdriver: [POST] https://ondemand.eu-central-1.saucelabs.com/wd/hub/session/bb84b5d5d1084984a4e7879c4a25eab5/url
[0-0] 2023-09-04T17:39:46.763Z INFO webdriver: DATA {
[0-0] url: 'http://localhost:52305/?cid=0-0&spec=/Users/gkostov/git/test/test/index.js'
[0-0] }
[0-0] 2023-09-04T17:39:51.701Z DEBUG webdriver: request failed due to response error: unknown error
[0-0] 2023-09-04T17:39:51.701Z INFO webdriver: Retrying 2/3
[0-0] 2023-09-04T17:39:51.701Z INFO webdriver: [POST] https://ondemand.eu-central-1.saucelabs.com/wd/hub/session/bb84b5d5d1084984a4e7879c4a25eab5/url
[0-0] 2023-09-04T17:39:51.701Z WARN webdriver: Request failed with status 500 due to unknown error: net::ERR_CONNECTION_REFUSED
[0-0] (Session info: chrome=116.0.5845.97)
[0-0] 2023-09-04T17:39:51.701Z INFO webdriver: DATA {
[0-0] url: 'http://localhost:52305/?cid=0-0&spec=/Users/gkostov/git/test/test/index.js'
[0-0] }
[0-0] 2023-09-04T17:39:54.417Z DEBUG webdriver: request failed due to response error: unknown error
[0-0] 2023-09-04T17:39:54.417Z INFO webdriver: Retrying 3/3
[0-0] 2023-09-04T17:39:54.417Z INFO webdriver: [POST] https://ondemand.eu-central-1.saucelabs.com/wd/hub/session/bb84b5d5d1084984a4e7879c4a25eab5/url
[0-0] 2023-09-04T17:39:54.417Z WARN webdriver: Request failed with status 500 due to unknown error: net::ERR_CONNECTION_REFUSED
[0-0] (Session info: chrome=116.0.5845.97)
[0-0] 2023-09-04T17:39:54.417Z INFO webdriver: DATA {
[0-0] url: 'http://localhost:52305/?cid=0-0&spec=/Users/gkostov/git/test/test/index.js'
[0-0] }
[0-0] 2023-09-04T17:39:59.040Z DEBUG webdriver: request failed due to response error: unknown error
[0-0] 2023-09-04T17:39:59.041Z ERROR webdriver: Request failed with status 500 due to unknown error: unknown error: net::ERR_CONNECTION_REFUSED
[0-0] (Session info: chrome=116.0.5845.97)
[0-0] 2023-09-04T17:39:59.041Z ERROR @wdio/runner: Failed to run browser tests with cid 0-0: unknown error: Failed to load test page to run tests, make sure your browser can access "http://localhost:52305"
[0-0] at getErrorFromResponseBody (file:///Users/gkostov/git/test/node_modules/webdriver/build/utils.js:194:12)
[0-0] at NodeJSRequest._request (file:///Users/gkostov/git/test/node_modules/webdriver/build/request/index.js:164:23)
[0-0] at processTicksAndRejections (node:internal/process/task_queues:96:5)
[0-0] at async Browser.wrapCommandFn (file:///Users/gkostov/git/test/node_modules/@wdio/utils/build/shim.js:72:29)
[0-0] at async Browser.wrapCommandFn (file:///Users/gkostov/git/test/node_modules/@wdio/utils/build/shim.js:72:29)
[0-0] at async BrowserFramework.#runSpec (file:///Users/gkostov/git/test/node_modules/@wdio/runner/build/browser.js:75:13)
[0-0] at async BrowserFramework.#loop (file:///Users/gkostov/git/test/node_modules/@wdio/runner/build/browser.js:62:25)
[0-0] at async BrowserFramework.run (file:///Users/gkostov/git/test/node_modules/@wdio/runner/build/browser.js:40:30)
[0-0] at async Runner.run (file:///Users/gkostov/git/test/node_modules/@wdio/runner/build/index.js:146:24)
[0-0] Error: Failed to load test page to run tests, make sure your browser can access "http://localhost:52305"
[0-0] 2023-09-04T17:39:59.042Z INFO webdriver: COMMAND deleteSession()
[0-0] 2023-09-04T17:39:59.042Z INFO webdriver: [DELETE] https://ondemand.eu-central-1.saucelabs.com/wd/hub/session/bb84b5d5d1084984a4e7879c4a25eab5
[0-0] 2023-09-04T17:39:59.216Z INFO webdriver: RESULT
2023-09-04T17:39:59.332Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in chrome - file:///test/index.js
2023-09-04T17:39:59.333Z INFO @wdio/cli:launcher: Run onWorkerEnd hook
2023-09-04T17:39:59.333Z DEBUG @wdio/cli:utils: Finished to run "onWorkerEnd" hook in 0ms
2023-09-04T17:39:59.333Z INFO @wdio/cli:launcher: Run onComplete hook
Code of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues