Open gerad opened 3 years ago
I was able to get the test passing by switching to using Promise.all
and adding a { qos: 1 }
to the publish.
diff --git a/test/basic.test.js b/test/basic.test.js
index 296c55a..c6d3ff6 100644
--- a/test/basic.test.js
+++ b/test/basic.test.js
@@ -24,9 +24,9 @@ test('Connect-Subscribe-Publish-Disconnect 300 clients using WS and MQTT/MQTTS p
}
var clients = await Promise.all(connects)
- await pMap(clients, c => c.subscribe('my/topic'), pMapOptions)
- await pMap(clients, c => c.publish('my/topic', 'I\'m client ' + c._client.options.clientId), pMapOptions)
- await pMap(clients, c => c.end(), pMapOptions)
+ await Promise.all(clients.map(c => c.subscribe('my/topic')))
+ await Promise.all(clients.map(c => c.publish('my/topic', 'I\'m client ' + c._client.options.clientId, { qos: 1 })))
+ await Promise.all(clients.map(c => c.end()))
})
test('Unhautorized client', async function (t) {
Note adding { qos: 1 }
to the subscribe caused it to hang again.
Hi @gerad , I don't think the problem is pMap, tests are always been very flaky and the reason is something else and I wasn't able to debug this last time I tried.
System Information
Describe the bug
Connect-Subscribe-Publish-Disconnect 300 clients using WS and MQTT/MQTTS
test hangs when runningTo Reproduce
Run the test:
NO_CLUSTERS=true DB=default npm run test
Additional context
await pMap(clients, c => c.end(), pMapOptions)
end()
promise never resolves for some of the clients.Here are the dependencies I have installed (just downloaded the repo and ran a fresh
npm install
).