From ccbfbaeafa0bce962f37993a2241dbf12e5cea85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 4 Sep 2026 11:53:57 +0200 Subject: [PATCH] Wait until a message is received when testing subscription of bus Closes #15065 --- trytond/trytond/tests/test_bus.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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, {