From 7cb70e9eceb5c939b2d7167e0ce08f887e865fb5 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 13 Jul 2016 09:12:59 -0700 Subject: [PATCH] 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 --- test/parallel/test-http-server-consumed-timeout.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-http-server-consumed-timeout.js b/test/parallel/test-http-server-consumed-timeout.js index 362b052ee78d58..799992e2c4a6ba 100644 --- a/test/parallel/test-http-server-consumed-timeout.js +++ b/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('.'); }));