From f9d1804857637d836d43647c09e9717dfdc7922a Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 15 Jul 2017 16:16:31 -0700 Subject: [PATCH] test: fix flaky test-net-can-reset-timeout Fixes: https://github.com/nodejs/node/issues/14241 --- test/parallel/test-net-can-reset-timeout.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-net-can-reset-timeout.js b/test/parallel/test-net-can-reset-timeout.js index a4bdd0bdee3313..69f6c9288b77f7 100644 --- a/test/parallel/test-net-can-reset-timeout.js +++ b/test/parallel/test-net-can-reset-timeout.js @@ -21,6 +21,9 @@ 'use strict'; const common = require('../common'); + +// Ref: https://github.com/nodejs/node-v0.x-archive/issues/481 + const net = require('net'); const server = net.createServer(common.mustCall(function(stream) { @@ -28,7 +31,7 @@ const server = net.createServer(common.mustCall(function(stream) { stream.resume(); - stream.on('timeout', common.mustCall(function() { + stream.once('timeout', common.mustCall(function() { console.log('timeout'); // try to reset the timeout. stream.write('WHAT.');