Skip to content

Commit 39f5d9c

Browse files
Trottevanlucas
authored andcommitted
test: fix flaky test-http-server-consumed-timeout
Using identical timeout values appears to have eliminated the flakiness in the test. Fixes: #7643 PR-URL: #7717 Reviewed-By: Fedor Indutny <[email protected]>
1 parent 4158272 commit 39f5d9c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/parallel/test-http-server-consumed-timeout.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

33
const common = require('../common');
4-
const assert = require('assert');
54
const http = require('http');
65

76
const server = http.createServer((req, res) => {
@@ -11,7 +10,7 @@ const server = http.createServer((req, res) => {
1110
res.flushHeaders();
1211

1312
req.setTimeout(common.platformTimeout(200), () => {
14-
assert(false, 'Should not happen');
13+
common.fail('Request timeout should not fire');
1514
});
1615
req.resume();
1716
req.once('end', common.mustCall(() => {
@@ -30,7 +29,7 @@ server.listen(0, common.mustCall(() => {
3029
setTimeout(() => {
3130
clearInterval(interval);
3231
req.end();
33-
}, common.platformTimeout(400));
32+
}, common.platformTimeout(200));
3433
});
3534
req.write('.');
3635
}));

0 commit comments

Comments
 (0)