Previously, the test could fail on slow machines because the
child process was still in the process of starting up after
one second, and not yet idle.
To resolve this:
- Wait for a message from the child process indicating that it
had started.
- Wait some time after that, but make it platform-dependent to
account for timing differences.
- Remove the timer in the child process.
PR-URL: https://github.com/nodejs/node/pull/31645
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>