test: improve assert message in http timeout test

PR-URL: https://github.com/nodejs/node/pull/22403
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Rich Trott 2018-08-19 16:56:11 -07:00
parent 4b71b01339
commit 36696cfe84

View File

@ -43,8 +43,10 @@ function doRequest() {
const duration = Date.now() - start;
// The timeout event cannot be precisely timed. It will delay
// some number of milliseconds.
assert.ok(duration >= HTTP_CLIENT_TIMEOUT,
`${duration} < ${HTTP_CLIENT_TIMEOUT}`);
assert.ok(
duration >= HTTP_CLIENT_TIMEOUT,
`duration ${duration}ms less than timeout ${HTTP_CLIENT_TIMEOUT}ms`
);
}));
req.end();