Merge pull request #1677 from sehrope/fix-network-partition-test-race

Fix network partition test race
This commit is contained in:
Charmander 2018-06-25 00:33:34 +00:00 committed by GitHub
commit 1cbd507b8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 () {