From be259de95f9a81f15b4246bdd8195e30d06dc753 Mon Sep 17 00:00:00 2001 From: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com> Date: Tue, 23 Apr 2024 17:01:56 +0200 Subject: [PATCH] test: fail faster if browser crashes (#12310) --- test/src/mocha-utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/src/mocha-utils.ts b/test/src/mocha-utils.ts index 333204d83b5..109aa728f15 100644 --- a/test/src/mocha-utils.ts +++ b/test/src/mocha-utils.ts @@ -161,6 +161,7 @@ export const setupTestBrowserHooks = (): void => { state.browser = await puppeteer.launch({ ...processVariables.defaultBrowserOptions, timeout: this.timeout() - 1_000, + protocolTimeout: this.timeout() * 2, }); } } catch (error) { @@ -207,6 +208,8 @@ export const getTestState = async ( if (!state.browser) { throw new Error('Browser was not set-up in time!'); + } else if (!state.browser.connected) { + throw new Error('Browser has disconnected!'); } if (state.context) {