mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(ff): allow more time to launch browser (#15290)
This commit is contained in:
parent
b86926e691
commit
6425ab9e78
@ -18,6 +18,7 @@
|
||||
import { debugMode } from '../utils';
|
||||
|
||||
export const DEFAULT_TIMEOUT = 30000;
|
||||
export const DEFAULT_LAUNCH_TIMEOUT = 3 * 60 * 1000; // 3 minutes
|
||||
|
||||
export class TimeoutSettings {
|
||||
private _parent: TimeoutSettings | undefined;
|
||||
@ -69,4 +70,12 @@ export class TimeoutSettings {
|
||||
return 0;
|
||||
return DEFAULT_TIMEOUT;
|
||||
}
|
||||
|
||||
static launchTimeout(options: { timeout?: number }): number {
|
||||
if (typeof options.timeout === 'number')
|
||||
return options.timeout;
|
||||
if (debugMode())
|
||||
return 0;
|
||||
return DEFAULT_LAUNCH_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ export abstract class BrowserType extends SdkObject {
|
||||
if (seleniumHubUrl)
|
||||
return this._launchWithSeleniumHub(progress, seleniumHubUrl, options);
|
||||
return this._innerLaunchWithRetries(progress, options, undefined, helper.debugProtocolLogger(protocolLogger)).catch(e => { throw this._rewriteStartupError(e); });
|
||||
}, TimeoutSettings.timeout(options));
|
||||
}, TimeoutSettings.launchTimeout(options));
|
||||
return browser;
|
||||
}
|
||||
|
||||
@ -82,7 +82,7 @@ export abstract class BrowserType extends SdkObject {
|
||||
controller.setLogName('browser');
|
||||
const browser = await controller.run(progress => {
|
||||
return this._innerLaunchWithRetries(progress, options, persistent, helper.debugProtocolLogger(), userDataDir).catch(e => { throw this._rewriteStartupError(e); });
|
||||
}, TimeoutSettings.timeout(options));
|
||||
}, TimeoutSettings.launchTimeout(options));
|
||||
return browser._defaultContext!;
|
||||
}
|
||||
|
||||
|
||||
@ -134,7 +134,7 @@ export const test = _baseTest.extend<TestFixtures, WorkerFixtures>({
|
||||
const browser = await playwright[browserName].launch();
|
||||
await use(browser);
|
||||
await browser.close();
|
||||
}, { scope: 'worker' } ],
|
||||
}, { scope: 'worker', timeout: 0 } ],
|
||||
|
||||
acceptDownloads: [ true, { option: true } ],
|
||||
bypassCSP: [ undefined, { option: true } ],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user