From e8f1d86c9530c620eae36384ac9c5743fa8a63b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Fri, 22 Oct 2021 09:39:55 +0000 Subject: [PATCH] [REV] mail: memleak model manager in tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4c18e2d09a372e975c2133516cc9bdd1880b2c1b. This commit makes a barcode qunit test crash non-deterministically, but quite frequently (50% of the time). At the time of reverting this commit, we still don't know how this commit affects this barcode test, but it's urgent to resolve by revert and understand more in depth what are the causes. closes odoo/odoo#78827 X-original-commit: 29eb6d3e5ea859955290a2c3f53908b80e16f03e Signed-off-by: Sébastien Theys (seb) --- addons/mail/static/src/utils/test_utils.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/addons/mail/static/src/utils/test_utils.js b/addons/mail/static/src/utils/test_utils.js index b42e65ce14e..49b3fed668e 100644 --- a/addons/mail/static/src/utils/test_utils.js +++ b/addons/mail/static/src/utils/test_utils.js @@ -24,7 +24,6 @@ import { mock, } from 'web.test_utils'; import Widget from 'web.Widget'; -import { registerCleanup } from '@web/../tests/helpers/cleanup'; import { createWebClient, getActionManagerServerData } from "@web/../tests/webclient/helpers"; import LegacyRegistry from "web.Registry"; @@ -319,6 +318,9 @@ function afterEach(self) { self.widget.destroy(); self.widget = undefined; } + if (self.messaging) { + self.messaging.delete(); + } self.env = undefined; self.unpatch(); } @@ -775,14 +777,6 @@ async function start(param0 = {}) { } returnCallbacks.forEach(callback => callback(result)); await waitUntilEventPromise; - registerCleanup(() => { - if (modelManager.messaging) { - modelManager.messaging.delete(); - } - if (widget) { - widget.destroy(); - } - }); return { ...result, createComposerComponent: getCreateComposerComponent({ components, env: testEnv, modelManager, widget }),