Nothing Special   »   [go: up one dir, main page]

Skip to content

Commit

Permalink
[IMP] core: handling of the form tour checker
Browse files Browse the repository at this point in the history
`DOM.querySelector` will generally return a `nodeId` of 0 when no node
is found, however there is a small window during which the document
can apparently get collected (?), which leads to an error

    Could not find node with given id

which can break otherwise successful builds (cf 20832402 / staging
60731).

Handle errors from the pipeline as if the node had not been found,
though the matter was not fully investigated so it's possible this
explanation is incomplete or incorrect.

The CDTP documentation does not document the failure modes for either
`DOM.getDocument` or `DOM.querySelector`.

closes #105109

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
  • Loading branch information
xmo-odoo committed Nov 15, 2022
1 parent 4595bed commit 5ef975f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions odoo/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import base64
import collections
import concurrent.futures
import contextlib
import difflib
import functools
import importlib
Expand Down Expand Up @@ -1330,9 +1331,11 @@ def _handle_console(self, type, args=None, stackTrace=None, **kw): # pylint: dis
)
@qs.add_done_callback
def _qs_result(fut):
# stupid dumbass chrome returns a nodeid of 0 when nothing
# is found
if fut.result()['nodeId']:
node_id = 0
with contextlib.suppress(Exception):
node_id = fut.result()['nodeId']

if node_id:
self.take_screenshot("unsaved_form_")
self._result.set_exception(ChromeBrowserException("""\
Tour finished with an open form view in edition mode.
Expand Down

0 comments on commit 5ef975f

Please sign in to comment.