Fix flaky test (#1158)

* Fix flaky test

* Fix #1154
This commit is contained in:
Tomas Della Vedova
2020-04-14 14:39:53 +02:00
committed by delvedor
parent a9e68110b5
commit 6ff1db20c4
4 changed files with 100 additions and 26 deletions

View File

@ -56,14 +56,17 @@ function buildCluster (options, callback) {
function shutdown () {
debug(`Shutting down cluster '${clusterId}'`)
Object.keys(nodes).forEach(kill)
for (const id in nodes) {
kill(id)
}
}
function kill (id) {
function kill (id, callback) {
debug(`Shutting down cluster node '${id}' (cluster id: '${clusterId}')`)
nodes[id].server.stop()
const node = nodes[id]
delete nodes[id]
delete sniffResult.nodes[id]
node.server.stop(callback)
}
function spawn (id, callback) {