Commit dd3679b
committed
[FIX] mail: fix retained memory in discuss call tests
Before this commit, discuss call HOOT tests retained the window
object after test ended.
Retained memory was about 2.5Mb-4Mb per test.
An earlier PR [1] fixed a similar issue from a `const` object being
used in field default value. This was a problem because JS models
internal code is keeping a reference to this object, and since HOOT
suite test reuses the same window object, the window of each test
were retained. The PR [1] fixed the issue by not setting object as
default value of the field.
Note that the default value and its presence in internal code of JS
models happened for all tests that use `@mail` static files. That
means this PR `[1]` fixed a retained memory for all `@mail` and
related tests.
While this fixed many tests, we still observed this retained memory
on all discuss call tests. This happens because while the default
value no longer uses this shared object, the computed value still
does. Therefore call tests were sharing the const and thus retaining
the window object. Note that the computed method is implicitly lazy,
so this is only invoked in code that actually uses this `iceServers`
field, hence why only discuss call tests were still affected by the
issue.
This commit fixes the issue by replacing the DEFAULT_ICE_SERVERS
object by GET_DEFAULT_ICE_SERVERS function. This ensures each test
use a different object, thus preventing retaining the window object
after test has ended.
[1]: odoo#204521
closes odoo#215208
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>1 parent 504ce79 commit dd3679b
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
0 commit comments