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 authored and Michaël Zasso committed 2018-09-03 17:56:23 +02:00
1 parent 22adebfc9a
commit e8e014a8dc
1 file changed
+4 -2
@@ -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();