From 4f8cec644ec4d594b5524bb0c6f0b4d1d28ab99d Mon Sep 17 00:00:00 2001 From: OverSu Date: Wed, 30 Sep 2026 23:24:13 +0200 Subject: [PATCH] Handle document replacement during desktop integration checks --- tools/check-desktop.py | 3 ++- tools/test-host.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/check-desktop.py b/tools/check-desktop.py index 4059ba08..19a6c62e 100644 --- a/tools/check-desktop.py +++ b/tools/check-desktop.py @@ -84,11 +84,12 @@ with tempfile.TemporaryFile() as display_file, (ROOT / "logs/xvfb.log").open("w" try: # Wait for Marionette initialization before opening the suite. with Client(2857) as client: + connected = True spec = importlib.util.spec_from_file_location("probe", ROOT / "tools/probe-desktop.py") probe = importlib.util.module_from_spec(spec) spec.loader.exec_module(probe) probe.register(client) - for _ in range(200): + for _ in range(600): ready = probe.evaluate(client, "system", "return document.body?.getAttribute('ready-state')==='fullyLoaded';") if ready.get("value"): break diff --git a/tools/test-host.py b/tools/test-host.py index 77e32516..a065d836 100644 --- a/tools/test-host.py +++ b/tools/test-host.py @@ -102,7 +102,16 @@ bc.currentWindowGlobal.getActor('VulpesProbe').sendQuery('Evaluate', CODE) last = None deadline = time.monotonic() + timeout while time.monotonic() < deadline: - last = evaluate(app, code) + try: + last = evaluate(app, code) + except AssertionError as error: + # Navigation can replace the document while its read-only probe is pending. + detail = error.args[0] if error.args else None + if not isinstance(detail, dict) or not detail.get("error", "").startswith( + "AbortError: Actor 'VulpesProbe' destroyed before query" + ): + raise + last = None if last: return last time.sleep(0.15)