details: https://code.tryton.org/tryton/commit/020452568c78
branch: default
user: Cédric Krier <[email protected]>
date: Fri Sep 04 11:53:57 2026 +0200
description:
Wait until a message is received when testing subscription of bus
Closes #15065
diffstat:
trytond/trytond/tests/test_bus.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (15 lines):
diff -r bfe3756af384 -r 020452568c78 trytond/trytond/tests/test_bus.py
--- a/trytond/trytond/tests/test_bus.py Thu Sep 03 15:49:20 2026 +0200
+++ b/trytond/trytond/tests/test_bus.py Fri Sep 04 11:53:57 2026 +0200
@@ -126,8 +126,9 @@
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, {