vitest
vitest copied to clipboard
Browser mode - page.goto: Navigation to "X" is interrupted by another navigation to "Y"
Describe the bug
Recently, I switched to experimental browser tests from happy-dom. It works great, but I encounter a strange problem when running them in CI (GitHub Actions), which occurs randomly. It seems like there is a missing 'await' or something like that. My test are pretty simple and synchronous.
The errors is following - page.goto: Navigation to "X" is interrupted by another navigation to "Y"
Reproduction
I am not sure if I am able to provide a minimal reproduction since the problem is non-deterministic, but I will give it a try if required.
System Info
System:
OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
CPU: (2) x64 Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz
Memory: 5.78 GB / 6.76 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 18.17.1 - /opt/hostedtoolcache/node/18.17.1/x64/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.6.7 - /opt/hostedtoolcache/node/18.17.1/x64/bin/npm
pnpm: 8.7.6 - ~/setup-pnpm/node_modules/.bin/pnpm
Browsers:
Chrome: 117.0.5938.88
Chromium: 117.0.5938.0
npmPackages:
@vitest/browser: ^0.34.5 => 0.34.5
@vitest/coverage-istanbul: ^0.34.5 => 0.34.5
vitest: ^0.34.5 => 0.34.5
Used Package Manager
pnpm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.
I'm also running into this issue. Using playwright and on multiple Node/OS versions (18/20 and Windows/linux).
Playwright 1.40.0 Vite 5.0.0 Vitest 0.34.6
same here, also in GitHub Actions
Chromium 120.0.6099.28 (playwright build v1091) Vitest 0.34.6 Vite 5.0.3 Playwright 1.40.1
also similar error sometimes happens in firefox (Firefox 119.0 (playwright build v1429)), likely related:
adding retry
parameter didn't help, so i ended up just doing retries at ci level for now:
- name: 'Run tests'
uses: nick-fields/retry@v2
with:
max_attempts: 3
timeout_minutes: 30
command: pnpm run test:browser --browser.name=${{ matrix.browser }}
Having the same error
Same