From 2dc5c6864b4b91ab96622cc638b6932259dab6f9 Mon Sep 17 00:00:00 2001 From: Sehrope Sarkuni Date: Sat, 16 Jun 2018 18:34:59 -0400 Subject: [PATCH] Change network partition test to wait for client socket creation prior to destroy --- test/integration/client/network-partition-tests.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/integration/client/network-partition-tests.js b/test/integration/client/network-partition-tests.js index e7198a47..8eaf5d0d 100644 --- a/test/integration/client/network-partition-tests.js +++ b/test/integration/client/network-partition-tests.js @@ -65,10 +65,12 @@ var testServer = function (server, cb) { server.close(cb) }) - // after 50 milliseconds, drop the client - setTimeout(function () { - server.drop() - }, 50) + server.server.on('connection', () => { + // after 50 milliseconds, drop the client + setTimeout(function () { + server.drop() + }, 50) + }) // blow up if we don't receive an error var timeoutId = setTimeout(function () {