Skip to content

Commit

Permalink
test: fix flaky test-http-server-consumed-timeout
Browse files Browse the repository at this point in the history
Using identical timeout values appears to have eliminated the flakiness
in the test.

Fixes: #7643
PR-URL: #7717
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
  • Loading branch information
Trott authored and MylesBorins committed Oct 26, 2016
1 parent 97a3d89 commit 924ea0a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/parallel/test-http-server-consumed-timeout.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const common = require('../common');
const assert = require('assert');
const http = require('http');

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

req.setTimeout(common.platformTimeout(200), () => {
assert(false, 'Should not happen');
common.fail('Request timeout should not fire');
});
req.resume();
req.once('end', common.mustCall(() => {
Expand All @@ -30,7 +29,7 @@ server.listen(0, common.mustCall(() => {
setTimeout(() => {
clearInterval(interval);
req.end();
}, common.platformTimeout(400));
}, common.platformTimeout(200));
});
req.write('.');
}));

0 comments on commit 924ea0a

Please sign in to comment.