[Bug]: page.waitForNetworkIdle timeout inconsistently

See original GitHub issue

Bug description

For some reason page.waitForNetworkIdle is timing out for no reason. the network is empty and even so it timeout after 30 seconds.

This error happens only sometimes and is very weird. Despite of that, I find a way to make it fail consistently by repeating some steps multiple times

Steps to reproduce the problem:

I created a repo with some simple puppeteer code

Locally

you can reproduce it locally by (my current local environment is WSL2 ubuntu)

  1. clone the repo
  2. install dependencies yarn
  3. yarn start

In GitHub Actions

  1. Create a new issue in the reproduction repo or use the issue test
  2. Create any comment
  3. Check the actions tab

Puppeteer version

“puppeteer”: “14.1.1”,

Node.js version

Local v16.15.0 / node 16

npm version

local 8.9.0 / actions https://github.com/actions/checkout

What operating system are you seeing the problem on?

Linux

Relevant log output

https://github.com/Josehower/puppetter-timeout-reproduction/runs/6524437119?check_suite_focus=true#step:4:20

file:///home/runner/work/puppetter-timeout-reproduction/puppetter-timeout-reproduction/upleveled-drone.mjs:18421
      rejectCallback(new TimeoutError("Timeout exceeded while waiting for event"));
                     ^

TimeoutError: Timeout exceeded while waiting for event
    at Timeout.<anonymous> (file:///home/runner/work/puppetter-timeout-reproduction/puppetter-timeout-reproduction/upleveled-drone.mjs:18421:22)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)

Thanks for any attention that you gave to this issue, puppeteer is an amazing tool that we use every day in my company. I am also open to creating a PR if we are able to identify what is the problem.

Good energy 👍👍👍👍

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
OrKoNcommented, May 23, 2022

Yeah, looks like some sort of bug! Thanks for reporting.

1reaction
OrKoNcommented, May 31, 2022

Hey, didn’t have time to look into that yet. The code for the function is here https://github.com/puppeteer/puppeteer/blob/main/src/common/Page.ts#L1944 It looks like sometimes the request count does not update as expected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

puppeteer wait for network idle after click
Any simple solution like page.waitForNavigation , e.g., page.waitForNetwork({waitUntil: 'networkidle0'}) ? Else, I'll raise a bug to the ...
Read more >
Page.waitForNetworkIdle() method
Page.waitForNetworkIdle() method. Signature:​. class Page { waitForNetworkIdle(options?: { idleTime?: number; timeout?: number; }): Promise<void>; } ...
Read more >
⚓ Query: Advanced Search
T304084 GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 5000 milliseconds with 0 bytes received (see ...
Read more >
Navigating & waiting
Every script that we will write will almost certainly do three key things: Navigating to some web page Waiting for something Possibly getting...
Read more >
cypress-network-idle
waitForNetworkIdle (2000) ... registerVisit({ timeout: 1000 }) it('waits for network idle', ... Return to top of pageSupport.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found