diff --git a/trytond/trytond/tests/test_bus.py b/trytond/trytond/tests/test_bus.py index 171a4208f1..8d8f55ffa6 100644 --- a/trytond/trytond/tests/test_bus.py +++ b/trytond/trytond/tests/test_bus.py @@ -126,8 +126,9 @@ class BusTestCase(TestCase): notify("Test", "Message", user=1) transaction.commit() # Let the listen thread registers the message - time.sleep(1) - response = Bus.subscribe(DB_NAME, ['user:1']) + while not ( + response := Bus.subscribe(DB_NAME, ['user:1'])).get('message'): + time.sleep(.01) self.assertTrue(response['message'].pop('message_id')) self.assertEqual(response, {