mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 09:47:56 +08:00
Only set the unhandled rejection handler once per process. We run the setup and teardown multiple times per-process now. Add clearPuppeteerState() to unset the state between runs on a parallel test runner. This is because the port changes between successive runs in the same process. Remove the hasShutdown logic from mocha_hooks. Also remove the beforeExit hook which was causing this to get called at least twice for every process. It already gets called in the ordinary shutdown case via the afterAll() hook. We only need to call it in the extraordinary case which is the SIGINT case. Now that we do the shutdown multiple times per process, we don't care if we already shutdown on this process or not. The only issue could be if ctrl+c is sent during the shutdown, but then we are crashing anyway. Right now the default # of jobs is 1, so out bots will still run in serial mode. We want to add parallel mode as an options for local development while we iron out any last problems with this approach. You can test this locally with npm run e2etests -- --jobs=8. We make use of global setup fixtures to only run one hosted mode server and share it between all parallel runners. Each runner still starts its own chrome and restarts it between files, which is a bit inefficient but still a big improvement compared to serial mode. Split the hosted mode server out into its own file inside conductor as it can be dealt with entirely separately, and its state is not per-process like the chrome state, but only per-main-process which launches the test runner sub-processes. Bug: 1101784 Change-Id: Ic0c9be3559708fd5403a88882b9fb93257633de9 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2288694 Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org> Commit-Queue: Peter Marshall <petermarshall@chromium.org>