The `afternextrender` helper is meant to be used in some tests that
want to do something after owl has completed all its work following
a specific action. It is useful when the action may cause some
additional renders, so waiting for one nextTick is not enough.
Unfortunately, it has a bug: it waits for Owl scheduler to be empty. But
in some cases, when a component is destroyed because of an error,
the scheduler task list will not be cleared until the next render
completes. It is implemented that way in Owl to reduce the amount of
work it does. But this means that in some testing scenarios, the
afterNextRender promise will simply not be resolved, since there is no
upcoming render to clear the tasklist.
With this commit, we just avoid the issue by ignoring the fibers coming
from destroyed component.
Note that I think that it is not a good semantic for tests, as it is a
little bit too "black-boxy". Ideally, we should rather wait for something
in the DOM. There is a waitUntil helper somewhere that may be useful for
this situation
closesodoo/odoo#115229
X-original-commit: ca8d1e7ea74120dd088c78bb4916aa994e852a0f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>
Before this commit the error raised/logged when rejecting the afterEvent
promise was imcomplete. This is due to the fact we're creating the
error inside the promise itself. In order to get a better stack trace,
the error is now declared outside of the promise.
Moreover, both `afterNextRender` and `afterEvent` functions were using
`console.error` before rejecting the promise. This is also a problem
since runbot will show the error printed by `console.error` instead of
the one of the test failure. In order to solve this issue, those two
`console.error` have been replaced by `console.warn`.
closesodoo/odoo#99899
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This owl update is significant: it introduces a change in the way
components are rendered: now, child components check if there is a
current rendering somewhere in their ancestors. If this is the case, the
rendering will be delayed. This prevents lots of issues where a
child components may be in some kind of corrupted state after some state
changes.
closesodoo/odoo#88572
X-original-commit: 93710d082bf860d0ea576fe99db9506af9bb42b0
Related: odoo/enterprise#26135
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Géry Debongnie <ged@odoo.com>