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

fix: Change networkidle2 to networkidle0 #2618

Conversation

YogeshSinghChouhan
Copy link
Contributor

Switch example to networkidle0 to solve inconsistency of console messages
Fixes #2587

Switch to networkidle0 to solve inconcistency of console messages
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@YogeshSinghChouhan
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@aslushnikov
Copy link
Contributor

This might make the race less bad, but it doesn't fix it.
Instead, we should await the event from the page, and then close the browser.

Feel free to send a separate PR for this.

@YogeshSinghChouhan
Copy link
Contributor Author

@aslushnikov i didn't understand your point ,i think we are awaiting the event and afterwards browser is closing. Please correct me , if i understood it wrong

@aslushnikov
Copy link
Contributor

@YogeshSinghChouhan The solution that waits for networkidle0 might mostly work but gives no guarantees: how's network idleness related to app-ready event?

The inconsistency happens because we sometimes close the browser before the app-ready event is dispatched. To fix the race condition the right way, we should wait for the app-ready event explicitly and then close the browser.

On a second thought, it doesn't hurt to land this CL since it makes things better without much effort, so I'll just merge it in.

@aslushnikov aslushnikov reopened this May 30, 2018
@aslushnikov aslushnikov merged commit e1c40bd into puppeteer:master May 30, 2018
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

Successfully merging this pull request may close these issues.

None yet

3 participants