test: fix flaky child-process-fork-regr-gh-2847
Pull Request check-list
Please make sure to review and check all of these items:
-
Does make -j8 test
(UNIX) orvcbuild test nosign
(Windows) pass with this change (including linting)? -
Is the commit message formatted according to CONTRIBUTING.md? -
If this change fixes a bug (or a performance problem), is a regression test (or a benchmark) included? -
Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
Affected core subsystem(s)
test
Description of change
The test is still failing sometimes because when trying to establish the second connection, the server is already closed. Bring back the code that handled this case and was removed in the last refactoring of the test: https://github.com/nodejs/node/commit/4e4b260b07dc2519aa5333b82e8f8a4aac861027.