Wait until a message is received when testing subscription of bus

Closes #15065
(grafted from 020452568c782b3d20fe64fe58e33088095125a1)

--HG--
branch : 8.0
This commit is contained in:
Cédric Krier
2026-09-04 11:53:57 +02:00
parent 0512626e26
commit 862ef8d408
+3 -2
View File
@@ -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, {