Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Adds a delay to wait for daemon to be started before connect. Gentoo bug 934153
- # https://github.com/greenbone/ospd-openvas/pull/1026
- --- a/tests/messaging/test_mqtt.py
- +++ b/tests/messaging/test_mqtt.py
- @@ -91,7 +91,17 @@ class MQTTDaemonTestCase(TestCase):
- daemon = MQTTDaemon(client)
- - daemon.run()
- + max_attempts = 5
- + attempts = 0
- + while attempts < max_attempts:
- + try:
- + daemon.run()
- + break
- + except AssertionError:
- + attempts += 1
- + time.sleep(1)
- + if attempts == 4:
- + sys.exit("Timeout waiting MQTTDaemon")
- client.connect.assert_called_with()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement