moscajs / aedes-tests

Integration/Black Box tests for Aedes MQTT Broker
MIT License
5 stars 1 forks source link

Fix will and wildecards subscriptions tests #4

Closed robertsLando closed 4 years ago

robertsLando commented 4 years ago

@mcollina Based on my tests the results are:

mcollina commented 4 years ago

Interesting that Mongo with cluster do not work. I think it might need some time to bring the cluster up?

robertsLando commented 4 years ago

@mcollina In my opinion it could be caused by mongo not ready when aedes start. All mongo persistence methods have once.ready listener (https://github.com/moscajs/aedes-persistence-mongodb/blob/master/persistence.js#L181) if the db is not ready and so it could loose some messages.

I could try to fix aedes process to wait db ready event

robertsLando commented 4 years ago

@mcollina I have removed all timeouts, I have also made aedes process waiting for db ready and a cleandb function to be sure there is not problems caused by someting already present inside dbs.

So everytime a test starts it starts the aedes process using a promise, that promise resolves when in order:

Even with this checks before run result are the same: everything is :+1: except mongo with clusters that seems to loose some messages randomly. Any ideas?

P.S: Remember to merge and release a new version of mqemitter-redis

robertsLando commented 4 years ago

@gnought Do you have any idea why mongo could cause that kind of errors with clusters?

mcollina commented 4 years ago

no

robertsLando commented 4 years ago

At least, are tests now good after latest fixes?

If tests are ok, after you publish mqemitter-redis on npm, I will bump that here then I merge this?

mcollina commented 4 years ago

the new version of mqemitter-redis is out.

robertsLando commented 4 years ago

@mcollina Ping