Wait until a message is received when testing subscription of bus

Closes #15065
(grafted from 020452568c782b3d20fe64fe58e33088095125a1)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier committed 2026-09-04 11:53:57 +02:00
1 parent 5e211dd515
commit 9c2d4bee74
1 file changed
+3 -2
+3 -2
View File
@@ -126,8 +126,9 @@ class BusTestCase(unittest.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, {