From 7294377cd96200c1b1e99e6c43d760d4ad6b65cc Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 27 Jul 2025 21:11:10 +0200 Subject: [PATCH 1/2] Implement a delay for Chrome protocol calls in the integration tests In Chrome protocol calls are faster than in Firefox and thus trigger in quicker succession. This can cause intermittent failures because new protocol calls can run before events triggered by the previous protocol calls had a chance to be processed (essentially causing events to get lost). This commit fixes the issue by configuring Chrome with a protocol call delay value that gives it a more similar execution speed as Firefox (which also gives us more consistency between the two browser runs). Note that this doesn't negatively impact the overall runtime of the integration tests because Puppeteer already waits for a test to complete in both browsers before continuing to the next one and Chrome consistently was, and with this patch still slightly is, faster in completing the tests. --- test/test.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test.mjs b/test/test.mjs index d837f46ac..5e4efc57c 100644 --- a/test/test.mjs +++ b/test/test.mjs @@ -910,6 +910,14 @@ async function startBrowser({ // crashes with timeouts or OOM if WebDriver BiDi is used (issue #17961). options.protocol = "cdp"; + // Slow down protocol calls by the given number of milliseconds. In Chrome + // protocol calls are faster than in Firefox and thus trigger in quicker + // succession. This can cause intermittent failures because new protocol + // calls can run before events triggered by the previous protocol calls had + // a chance to be processed (essentially causing events to get lost). This + // value gives Chrome a more similar execution speed as Firefox. + options.slowMo = 5; + // avoid crash options.args = ["--no-sandbox", "--disable-setuid-sandbox"]; // silent printing in a pdf From 17dc9e9917e59ead7fd3d30ef329d2fd919a6372 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Mon, 28 Jul 2025 21:08:12 +0200 Subject: [PATCH 2/2] Skip the "must check that an existing highlight is ignored on hovering" integration test on Windows This is a temporary measure to reduce noise until #20136 is fixed. Note that this shouldn't be an issue in terms of coverage because we still run the test on Linux. --- test/integration/highlight_editor_spec.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/integration/highlight_editor_spec.mjs b/test/integration/highlight_editor_spec.mjs index 2c4dd0f6c..c23f9999a 100644 --- a/test/integration/highlight_editor_spec.mjs +++ b/test/integration/highlight_editor_spec.mjs @@ -1853,6 +1853,12 @@ describe("Highlight Editor", () => { it("must check that an existing highlight is ignored on hovering", async () => { await Promise.all( pages.map(async ([browserName, page]) => { + if (navigator.platform.includes("Win")) { + // Skip the test on Windows because it permafails. + // TODO: Remove this check once #20136 is fixed. + return; + } + await switchToHighlight(page); const rect = await getSpanRectFromText(