question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

  • Puppeteer version: 1.9.0-post (chromium_revision 599821)
  • Platform / OS version: Windows 7 x64
  • URLs (if applicable): https://www.hackterms.com/
  • Node.js version: 10.12.0 or last 11.0.0 v8-canary

Is there a cause that the same code with the same puppeteer on the same OS works right on two different machines in headful mode, while in headless mode on one machine is constantly OK and on the second machine constantly produces timeout?

'use strict';

const puppeteer = require('puppeteer');

(async function main() {
  try {
    const browser = await puppeteer.launch({ headless: false });
    const [page] = await browser.pages();

    await page.goto('https://www.hackterms.com/');

    console.log(await page.evaluate(() => document.title));

    await browser.close();
  } catch (err) {
    console.error(err);
  }
})();

Otput on both machines:

Hackterms: a dictionary of programming terms
'use strict';

const puppeteer = require('puppeteer');

(async function main() {
  try {
    const browser = await puppeteer.launch();
    const [page] = await browser.pages();

    await page.goto('https://www.hackterms.com/');

    console.log(await page.evaluate(() => document.title));

    await browser.close();
  } catch (err) {
    console.error(err);
  }
})();

The same output on one machine, the error on the second machine:

{ TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
    at Promise.then (puppeteer\lib\FrameManager.js:1230:21)
  -- ASYNC --
    at Frame.<anonymous> (puppeteer\lib\helper.js:144:27)
    at Page.goto (puppeteer\lib\Page.js:579:49)
    at Page.<anonymous> (puppeteer\lib\helper.js:145:23)
    at main (test.js:10:16)
    at process.internalTickCallback (internal/process/next_tick.js:77:7) name: 'TimeoutError' }

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
sraducommented, Oct 26, 2018

Got it @aslushnikov! Sorry to butt in.

1reaction
vsemozhetbytcommented, Nov 2, 2018

@aslushnikov Unfortunately, --enable-features=NetworkService does not this issue. And I’ve tested with no anti-virus or firewall on.

I will close for now due to an undetectable cause.

Thank you all for the efforts to help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress and Flaky Tests: How to Handle Timeout Errors
Asynchronous operations are not completing before Cypress runs a command, causing a timeout error. Flaky Cypress Tests Caused by Timeout Errors.
Read more >
How to Fix Flaky Tests - Semaphore CI
Flaky tests hinder development, slow down progress, hide design problems, and can cost a lot of money in the long run.
Read more >
Flaky timeouts in mochitest-plain now fail newly added tests
"Test attempted to use a flaky timeout value 5000" And he will be baffled like me and some colleagues this morning about the...
Read more >
How to reduce flaky test failures - CircleCI
Find out whether your tests are flaky and learn how to fix them. ... tests fail because the wait time exceeds the timeout...
Read more >
How to handle flaky tests | Serverless First
Flaky tests are automated tests that are non-deterministic. ... Set a higher default timeout for all E2E tests (either via the test runner ......
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