Skip to content

Commit f8b32d9

Browse files
TrottMyles Borins
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 a2c9444 commit f8b32d9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

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

76
constserver=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)