test: improve test-https-server-keep-alive-timeout
The test is flaky under load. These changes greatly improve reliability.
- Use a recurring interval to determine when the test should end rather than a timer.
- Increase server timeout to 500ms to allow for events being delayed by system load
Changing to an interval has the added benefit of reducing the test run time from over 2 seconds to under 1 second.
Fixes: https://github.com/nodejs/node/issues/13307
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
test https