mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: fail faster if browser crashes (#12310)
This commit is contained in:
parent
a94fee9c66
commit
be259de95f
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user