larsthorup/mocha-vite-puppeteer

Fails with Timeout: "Only Chrome at revision r901912 is guaranteed to work."

fatso83 opened this issue · 3 comments

Hi, trying to run the example in the README, using the provided index.html, only modified to use my glob test/**/*.test.js. When doing that, it fails after 30 seconds:

TimeoutError: Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r901912 is guaranteed to work.

I know providing your own Chromium instance can do this, but I have not:

$ printenv  | grep PUPPETEER_

is empty, so no scary overrides.

Running Node 16 and mocha-vite-puppeteer 1.8.0

Full output:

$ pnpx mocha-vite-puppeteer --port 5005
Pre-bundling dependencies:
  moment/locale/nb
  moment
  react
  react-dom
  tcomb/lib/installTypeFormatter
  (...and 191 more)
(this will be run only when your dependencies or config have changed)

  vite v2.5.1 dev server running at:

  > Local: http://localhost:5005/
  > Network: use `--host` to expose
/home/myuser/dev/nicecorp/frontend/node_modules/.pnpm/puppeteer@10.2.0_c70f8fc5586dd378b8c866035dbe710b/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:208
            reject(new Errors_js_1.TimeoutError(`Timed out after ${timeout} ms while trying to connect to the browser! Only Chrome at revision r${preferredRevision} is guaranteed to work.`));
                   ^

TimeoutError: Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r901912 is guaranteed to work.
    at Timeout.onTimeout (/home/myuser/dev/nicecorp/frontend/node_modules/.pnpm/puppeteer@10.2.0_c70f8fc5586dd378b8c866035dbe710b/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:208:20)

Addendum

I even changed the test imports path to just reference a single file, but it still failed nonetheless, so it seems like I need more output from what is going on under the hood with Puppeteer. Adding --debug --verbose did not expose any more details!

    const modules = import.meta.globEager("/test/selectors.test.js"); 

Hey, thank you for the bug report. I quickly re-ran the GitHub Action on this repo which passes successfully (https://github.com/larsthorup/mocha-vite-puppeteer/actions/runs/1071351391), and similarly ran a demo project of mine https://github.com/larsthorup/vite-sandbox/ which also passes successfully.

I can see that you are not using "npm" but "pnpm", which I have not used before. Could I ask you to clone and test both this repo and my vite-sandbox repo mentioned above, and report back if those work for you using "pnpm"?

Another question is whether you might have puppeteer installed "globally" (if pnpm has that concept, like npm), so that mocha-vite-puppeteer is picking up that global version and not liking it?

Hi, two hours of debugging later, I think this came down to a corrupted file system or something like that (probably killing VMWare one too many times corrupted the EXT4 fs one time too many). I added lots of debugging statements to the cli.js script, turning on dumpio, etc and they all hung after starting the process, including when I tried another executable using the PUPPETEER_EXECUTABLE_PATH line. But playing with this also ended up totally hanging my VM (100% cpu) for a couple of times, so after a few rounds of that, I was starting to suspect other issues than the ones in userspace ...

I now reinstalled a fresh Ubuntu 21.04 (cloning the exact setup using my dotfiles), and this is no longer an issue. So yeah, "hardware" (if you can say that about a VM). Instead I have other issues, but that is not something to poke around with in this issue 😃