From 48e41617f57040bd6f5abb157d58c77424c4eae7 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sat, 14 Oct 2023 18:02:02 +0200 Subject: [PATCH 1/2] Remove Escape key press from the `autoprint` integration test It's not necessary because we have configured silent printing for Firefox and Chrome in the browser arguments we pass in `test.mjs`. This means that the print dialog is not even shown at all or disappears automatically once printing is done, so the Escape key press serves no purpose. Since it has been shown to time out, likely because the page loses focus during printing, and because the page itself doesn't know when the printing dialog is shown and we therefore can't possibly do the key press at the right time anyway, this commit gets rid of it to stabilize the test. --- test/integration/scripting_spec.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/test/integration/scripting_spec.mjs b/test/integration/scripting_spec.mjs index 0a714f99427f9..70eb631a56fa2 100644 --- a/test/integration/scripting_spec.mjs +++ b/test/integration/scripting_spec.mjs @@ -1793,7 +1793,6 @@ describe("Interaction", () => { await Promise.all( pages.map(async ([browserName, page]) => { await page.waitForSelector(".printedPage"); - await page.keyboard.press("Escape"); }) ); }); From 0c763d6c5a5e8b334968ab82e189567aacbf1ec5 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sat, 14 Oct 2023 18:05:44 +0200 Subject: [PATCH 2/2] Tweak the protocol timeout configuration for Puppeteer The previous change that set the timeout had effect because we have seen quite a few protocol timeouts now correctly being raised in the context of the active test, however we have also still seen a handful of cases where this wasn't the case and the one second difference turned out to be too low (likely because the operation was started slightly after one second into the test run). We therefore tweak the value to be 75% of the Jasmine timeout. This should be enough to catch operations that happen later on in the test run, and if a single operation takes that long any hope for success is already gone anyway. --- test/test.mjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test.mjs b/test/test.mjs index 1608ee7382508..a3dfa741b9c49 100644 --- a/test/test.mjs +++ b/test/test.mjs @@ -910,8 +910,11 @@ async function startBrowser(browserName, startUrl = "") { // The timeout for individual protocol (CDP) calls should always be lower // than the Jasmine timeout. This way protocol errors are always raised in // the context of the tests that actually triggered them and don't leak - // through to other tests (causing unrelated failures or tracebacks). - protocolTimeout: /* jasmine.DEFAULT_TIMEOUT_INTERVAL = */ 30000 - 1000, + // through to other tests (causing unrelated failures or tracebacks). The + // timeout is set to 75% of the Jasmine timeout to catch operation errors + // later in the test run and because if a single operation takes that long + // it can't possibly succeed anymore. + protocolTimeout: 0.75 * /* jasmine.DEFAULT_TIMEOUT_INTERVAL = */ 30000, }; if (!tempDir) {