Skip to content
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

Need to wait a second before the first page.goto with Puppeteer 23.4 #596

Open
jamesgpearce opened this issue Sep 23, 2024 · 1 comment
Open

Comments

@jamesgpearce
Copy link

🐛 Bug Report

Filing here for visibility, though it seems to be wholly caused by upgrading Puppeteer 23.4. (I wonder if it's to do with how jest-puppeteer initializes the browser?)

To Reproduce

  • Ensure Puppeteer 23.4
  • Run a test suite containing multiple await page.goto('...');
  • The first one or two will fail: net::ERR_CONNECTION_REFUSED at ...
  • Subsequent tests will pass

The failures can be fixed by sleeping for a second before the first page.goto, as though somehow the browser isn't ready, or isn't immediately connected to the network properly.

https://github.com/tinyplex/tinybase/blob/248bb46c69e7963bede5e9c2d25768335f9d093b/test/e2e/common.ts#L40-L47

Expected behavior

  • With Puppeteer 23.3 they all pass.

npx envinfo

## System:
 - OS: macOS 14.5
 - CPU: (8) arm64 Apple M2
 - Memory: 826.06 MB / 16.00 GB
 - Shell: 5.9 - /bin/zsh
## Binaries:
 - Node: 22.8.0 - /opt/homebrew/bin/node
 - npm: 10.8.2 - /opt/homebrew/bin/npm
 - pnpm: 9.1.4 - /opt/homebrew/bin/pnpm
 - bun: 1.1.3 - ~/.bun/bin/bun
 - Watchman: 2024.09.09.00 - /opt/homebrew/bin/watchman
## npmPackages:
 - jest-puppeteer: ^10.1.1 => 10.1.1 
@gregberge
Copy link
Member

Hello @jamesgpearce, maybe you should fill an issue in Puppeteer. Because browser should be ready, I mean there is no reason to warm it up on our side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants