From 3e6e63406d04093be39bafab84845365a1d0c971 Mon Sep 17 00:00:00 2001 From: Timothy J Fontaine Date: Tue, 18 Feb 2014 13:09:41 -0800 Subject: [PATCH] test: make test-net-error-twice less racey --- test/simple/test-net-error-twice.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/simple/test-net-error-twice.js b/test/simple/test-net-error-twice.js index 5435930a24..5ab370eb33 100644 --- a/test/simple/test-net-error-twice.js +++ b/test/simple/test-net-error-twice.js @@ -36,15 +36,18 @@ var srv = net.createServer(function onConnection(conn) { if (errs.length > 1 && errs[0] === errs[1]) assert(false, "We should not be emitting the same error twice"); }); + conn.on('close', function() { + srv.unref(); + }); }).listen(common.PORT, function () { var client = net.connect({ port: common.PORT }); client.on('connect', function () { - client.resume(); client.destroy(); }); -}).unref(); +}); process.on('exit', function() { + console.log(errs); assert.equal(errs.length, 1); });