From c0ce42293540f95437b24b223bf26a70c41df4aa Mon Sep 17 00:00:00 2001 From: tsm-odoo Date: Fri, 7 Apr 2023 06:11:26 +0000 Subject: [PATCH] [FIX] bus: solve indeterministic error in `TestWebsocketCaryall` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR fixes the `15350`runbot issue that was due to the websocket subscribe not being properly awaited before logging out.When the log out occurred before the subscribe was received, the `odoo_ws` variable was `None`. closes odoo/odoo#118097 X-original-commit: 59af91840c3ed7253c1c3c9dd80a4919ebdee593 Signed-off-by: Alexandre Kühn (aku) --- addons/bus/tests/test_websocket_caryall.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/bus/tests/test_websocket_caryall.py b/addons/bus/tests/test_websocket_caryall.py index 23d0992e1a7..a6b15ea8df0 100644 --- a/addons/bus/tests/test_websocket_caryall.py +++ b/addons/bus/tests/test_websocket_caryall.py @@ -148,11 +148,11 @@ class TestWebsocketCaryall(WebsocketCase): 'event_name': 'subscribe', 'data': {'channels': ['channel1'], 'last': 0} })) + subscribe_done_event.wait(timeout=5) self.url_open('/web/session/logout') # Simulate postgres notify. The session with whom the websocket # connected has been deleted. WebSocket should be closed without # receiving the message. - subscribe_done_event.wait(timeout=5) self.env['bus.bus']._sendone('channel1', 'notif type', 'message') odoo_ws.trigger_notification_dispatching() self.assert_close_with_code(websocket, CloseCode.SESSION_EXPIRED)