summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy J Fontaine <tjfontaine@gmail.com>2014-02-18 13:09:41 -0800
committerTimothy J Fontaine <tjfontaine@gmail.com>2014-02-18 13:10:09 -0800
commit3e6e63406d04093be39bafab84845365a1d0c971 (patch)
treeb8fd49deaa7a78c2135c5436e938d1327fde6964
parentc2aea3747dafaa979c9d21cc7acead32324bfb3a (diff)
downloadnode-3e6e63406d04093be39bafab84845365a1d0c971.tar.gz
test: make test-net-error-twice less racey
-rw-r--r--test/simple/test-net-error-twice.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/simple/test-net-error-twice.js b/test/simple/test-net-error-twice.js
index 5435930a2..5ab370eb3 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);
});