Git Product home page Git Product logo

Comments (2)

gerad avatar gerad commented on August 20, 2024

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.

from aedes-tests.

robertsLando avatar robertsLando commented on August 20, 2024

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.

from aedes-tests.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.