Browse Source

test: fix flaky test-http-server-consumed-timeout

Using identical timeout values appears to have eliminated the flakiness
in the test.

Fixes: https://github.com/nodejs/node/issues/7643
PR-URL: https://github.com/nodejs/node/pull/7717
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
v4.x
Rich Trott 9 years ago
committed by Myles Borins
parent
commit
924ea0a2bd
  1. 5
      test/parallel/test-http-server-consumed-timeout.js

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

@ -1,7 +1,6 @@
'use strict';
const common = require('../common');
const assert = require('assert');
const http = require('http');
const server = http.createServer((req, res) => {
@ -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(() => {
@ -30,7 +29,7 @@ server.listen(0, common.mustCall(() => {
setTimeout(() => {
clearInterval(interval);
req.end();
}, common.platformTimeout(400));
}, common.platformTimeout(200));
});
req.write('.');
}));

Loading…
Cancel
Save