Skip to content

Commit a7219bb

Browse files
committed
[FIX] bus: non deterministic subscription test
This commit fixes the `subscribe to presence channels according to store data` test. Some of the websocket worker functions are debounced meaning some old worker functions can be called after the test ends. Since `_patchWebsocketWorker` with cleanup patches the prototype of the worker, patches can be executed from old workers which is an issue. This commit ensures only the actual instance is patched. fixes runbot-226354 closes odoo#216879 X-original-commit: 49060aa Signed-off-by: Didier Debondt (did) <[email protected]>
1 parent b3f66a2 commit a7219bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/bus/static/tests/legacy/helpers/mock_websocket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ export function patchWebsocketWorkerWithCleanup(params = {}) {
7777
return new WebSocketMock();
7878
},
7979
});
80-
patchWithCleanup(websocketWorker || WebsocketWorker.prototype, params);
8180
websocketWorker = websocketWorker || new WebsocketWorker();
81+
patchWithCleanup(websocketWorker, params);
8282
websocketWorker.INITIAL_RECONNECT_DELAY = 0;
8383
websocketWorker.RECONNECT_JITTER = 0;
8484
patchWithCleanup(browser, {

0 commit comments

Comments
 (0)