Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix flaky test-http-client-timeout-with-data
test-http-client-timeout-with-data has failed here and there in CI on FreeBSD and OS X. The test has a socket timeout set to 50ms and a timer set for 100ms. However, they are not necessarily set in the same tick of the event loop and their ordering is therefore not guaranteed. Instead of using a timer, this change listens for an event on the listener to know when the socket timeout has occurred and then runs the code originally in the timer. Additional refactoring: Replaced `process.on('exit', ...)` checks with `common.mustCall()` and replaced usage of `assert.equal()` with `assert.strictEqual()`. PR-URL: #10431 Reviewed-By: James M Snell <[email protected]>
- Loading branch information