You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I provided exact source code that allows reproducing the issue locally.
Config file
// playwright.config.tsimport{defineConfig,devices}from'@playwright/test';exportdefaultdefineConfig({webServer: {command: 'node ./start-server.js',url: 'http://localhost:10039',// I also tested with 127.0.0.1 with the same result.timeout: 120*1000,reuseExistingServer: false},use: {baseUrl: 'http://localhost:10039'}});
$http_proxy, $https_proxy, $no_proxy, and their upper case versions are all unset.
.yarnrc includes proxy and https-proxy settings.
Steps
Run DEBUG=pw:webserver npx playwright test
Expected
Ignore other proxy envs (like npm_config_proxy) other than http_proxy, https_proxy to match browser behavior.
Playwright v.1.31.1 and below.
$ npx playwright test
[timestamp] pw:server HTTP GET: http://localhost:10039/
[timestamp] pw:server Error while checking if http://localhost:10039/ is available: connect ECONNREFUSED ::1:10039
[timestamp] pw:server Starting WebServer process node ./start-server.js
[timestamp] pw:server Process started
[timestamp] pw:server Waiting for availability...
[timestamp] pw:server HTTP GET http://localhost:10039/
[timestamp] pw:server Error while checking if http://localhost:10039/ is available: connect ECONNREFUSED ::1:10039
[timestamp] pw:server Waiting 100ms
...
[timestamp] pw:server HTTP GET: http://localhost:10039/
[around 20s] pw:server HTTP Status: 200
[timestamp] pw:server WebServer available
Actual
Network pinging uses other proxy envs (like npm_config_proxy) other than http_proxy, https_proxy.
Playwright v1.31.2 and above. I am only able to reproduce it in our company's GitLab CI K8S environment. I tried reproducing it locally (Podman container) and v1.31.2 and above works fine.
$ npx playwright test
[timestamp] pw:server HTTP GET: http://localhost:10039/
[timestamp] pw:server HTTP Status: 407
[timestamp] pw:server Starting WebServer process node ./start-server.js
[timestamp] pw:server Process started
[timestamp] pw:server Waiting for availability...
[timestamp] pw:server HTTP GET http://localhost:10039/
[timestamp] pw:server HTTP Status: 407
[timestamp] pw:server Waiting 100ms
...
[timestamp] pw:server HTTP GET: http://localhost:10039/
[timestamp] pw:server HTTP Status: 407
Error: Timed out waiting 120000ms from config.webServer.
error Command failed with exit code 1.
Seeing the changes of v1.31.2 related to webServer (#21227), I made my own debug script. But my script runs fine in v1.31.2 and above:
I found the issue, v1.31.2+ uses .yarnrc's configuration for proxy and https-proxy. We specified them for package download, but did not expect them to take effect for playwright's CLI when running through yarn yarn test ("test": "npx playwright test") instead of npx playwright test. Is this behavior expected or out of bound for a playwright issue?
I have updated issue's title.
danvim
changed the title
[BUG] webServer fails to ping running server with 407 proxy authentication required error
[BUG] webServer uses proxy settings in .yarnrc for v1.13.2+ when running via yarn
May 24, 2023
aslushnikov
changed the title
[BUG] webServer uses proxy settings in .yarnrc for v1.13.2+ when running via yarn
[BUG] webServer uses proxy settings in .yarnrc for v1.31.2+ when running via yarn
May 24, 2023
System info
Source code
Config file
/etc/hosts
$http_proxy, $https_proxy, $no_proxy, and their upper case versions are all unset.
.yarnrc includes proxy and https-proxy settings.
Steps
DEBUG=pw:webserver npx playwright test
Expected
Ignore other proxy envs (like npm_config_proxy) other than http_proxy, https_proxy to match browser behavior.
Playwright v.1.31.1 and below.
Actual
Network pinging uses other proxy envs (like npm_config_proxy) other than http_proxy, https_proxy.
Playwright v1.31.2 and above. I am only able to reproduce it in our company's GitLab CI K8S environment. I tried reproducing it locally (Podman container) and v1.31.2 and above works fine.
Seeing the changes of v1.31.2 related to webServer (#21227), I made my own debug script. But my script runs fine in v1.31.2 and above:
test-server.js
Removing webServer config and running this also works fine:
The text was updated successfully, but these errors were encountered: