From ea05ba6a31a33e3dc24c690cf3757f3f328c2662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Mon, 30 Nov 2026 17:07:10 -0300 Subject: [PATCH] test: a check run while the page reloads tries again instead of failing (CI run 397) Page.reload returns before the old page is gone; a check sent in that gap got 'Inspected target navigated or closed'. waitFor retries only that kind of error; any other still fails the test. Co-Authored-By: Claude Opus 5.5 --- tests/browser_test.mjs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/browser_test.mjs b/tests/browser_test.mjs index 5c7a717..bf71c53 100644 --- a/tests/browser_test.mjs +++ b/tests/browser_test.mjs @@ -25,7 +25,13 @@ const pause=ms=>new Promise(r=>setTimeout(r,ms)); let stderr='';chrome.stderr.on('data',data=>stderr+=data.toString()); const clients=[]; let kanban,testMachine; -async function waitFor(fn,description,timeout=30000){const end=Date.now()+timeout;while(Date.now()/navigated or closed|context was destroyed|Cannot find (default )?(execution )?context/i + .test(String(error?.message||error)); +async function waitFor(fn,description,timeout=30000){const end=Date.now()+timeout;while(Date.now(){const d=JSON.parse(event.data);if(d.id){const p=this.pending.get(d.id);if(p){this.pending.delete(d.id);d.error?p.reject(d.error):p.resolve(d.result);}}else if(d.method==='Runtime.exceptionThrown')this.errors.push(d.params.exceptionDetails);};