robotframework-mqttlibrary icon indicating copy to clipboard operation
robotframework-mqttlibrary copied to clipboard

Changed library to use background loop instead of manually looping

Open juha-ylikoski opened this issue 4 years ago • 1 comments

Addresses #25

This pull requests tries to fix problems with mqtt broker suddenly disconnecting. #4 thinks it might be related to looping mechanism somehow not working properly with robot.

Changes

  • Changed looping mechanism to be background looping with self._mqttc.loop_start() and self._mqttc.loop_stop()
  • Fixed mosquitto test case documentation + added conf
    • Since mosquitto 2.0 auth mechanism is required to specify https://mosquitto.org/documentation/authentication-methods/

TODO

Some pub/sub test cases are still failing. This is caused by them being synchronous.

Example:

Test case Publish a message with QOS 1 and validate that the message is received first sends a message to broker and reconnects, subscribes and tries to receive it. Due to this case using synchronous Subscribe And Validate message which was sent before has already timed out and cannot be received.

juha-ylikoski avatar Jun 14 '21 20:06 juha-ylikoski

@randomsync what is your opinion on these test cases failing due to them being synchronous when they maybe should not be. I could make them asynchronous but I'm not sure how we could test synchronous receiving (in my opinion it is too time sensitive and prone to failures).

Github is not letting me to include log.html but travis should have one shortly with the same issue.

juha-ylikoski avatar Jun 14 '21 20:06 juha-ylikoski