phetsims / perennial

Maintenance tools that won't change with different versions of chipper checked out
MIT License
3 stars 5 forks source link

Upgrade to puppeteer/playwright #393

Open zepumph opened 1 week ago

zepumph commented 1 week ago

This has been on my list for some time, but I believe this is causing some trouble over in https://github.com/phetsims/aqua/issues/219. On sparky I get some errors like:


90|ct-node-puppeteer-client   | 2024-10-30T16:22:45: error: FAILED TO RUN TEST, Tried to run 3 times, never completed, failure: Error: TimeoutError: Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r1056772 is guaranteed to work.
90|ct-node-puppeteer-client   | browserPageLoad caught unexpected error: TimeoutError: Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r1056772 is guaranteed to work.

I went through all release notes, and no breaking changes will effect us (that I saw) From https://github.com/puppeteer/puppeteer/releases?page=32 to page 1.

Local testing is going well.

I'm also interested in looking into #372 while here, so that we are all using the same version of puppeteer as needed.

zepumph commented 1 week ago

grunt generate-phet-io-api works for one repo, but not for --stable.

OOOPS, because I had --transpile=false set.

zepumph commented 1 week ago

~23.6.1

zepumph commented 1 week ago

Some more errors I'm seeing using tsx to launch puppeteer 19:

ct-chrom | 2024-10-31T17:59:03: (node:10112) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 101 SIGINT listeners added to [process]. MaxListeners is 100. Use emitter.setMaxListeners() to increase limit
2|ct-chrom | 2024-10-31T17:59:03: (node:10112) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 101 SIGTERM listeners added to [process]. MaxListeners is 100. Use emitter.setMaxListeners() to increase limit
2|ct-chrom | 2024-10-31T17:59:08: (node:10112) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 101 exit listeners added to [process]. MaxListeners is 100. Use emitter.setMaxListeners() to increase limit
2|ct-chrom | 2024-10-31T17:59:08: (node:10112) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 101 SIGHUP listeners added to [process]. MaxListeners is 100. Use emitter.setMaxListeners() to increase limit

/data/share/phet/continuous-testing/ct-main/ct-snapshots/1730416779720/chipper/node_modules/puppeteer-core/lib/cjs/puppeteer/node/BrowserRunner.js:299
            reject(new Error([
                   ^

Error: Failed to launch the browser process!
[1031/172614.643687:WARNING:discardable_shared_memory_manager.cc(197)] Less than 64MB of free space in temporary directory for shared memory files: 0
[1031/172614.650995:ERROR:file_path_watcher_inotify.cc(333)] inotify_init() failed: Too many open files (24)
zepumph commented 6 days ago

All the above issues were about a memory leaked solved over in https://github.com/phetsims/aqua/issues/219#issuecomment-2452323805.

From here. @samreid and I were wondering if we should instead focus on bringing playwright up to a more modern version instead of puppeteer. It may be time better spent, but it isn't clear right now. I'll investigate.