vitest icon indicating copy to clipboard operation
vitest copied to clipboard

Browser mode - page.goto: Navigation to "X" is interrupted by another navigation to "Y"

Open Joozty opened this issue 1 year ago • 4 comments

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"

image

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

Joozty avatar Sep 24 '23 18:09 Joozty

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

hugo-vrijswijk avatar Nov 20 '23 13:11 hugo-vrijswijk

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: image


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 }}

teidesu avatar Dec 02 '23 17:12 teidesu

Having the same error

mat926 avatar Jan 22 '24 14:01 mat926

Same

okasi avatar Jan 23 '24 14:01 okasi