Skip to content

Commit

Permalink
fix: Set global timeout conditionally (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexplischke authored Aug 31, 2023
1 parent e453510 commit 62ed9ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/playwright-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,6 @@ async function runPlaywright(nodeBin: string, runCfg: RunnerConfig): Promise<Run
playwrightBin, 'test'
];

// Default value for timeout (30min)
if (!suite.param.globalTimeout) {
suite.param.timeout = 1800000;
}
let args: Record<string, unknown> = _.defaultsDeep(defaultArgs, utils.replaceLegacyKeys(suite.param));

// There is a conflict if the playwright project has a `browser` defined,
Expand Down
6 changes: 6 additions & 0 deletions src/sauce.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ for (const file of configFiles) {
}
}

// Set a default timeout of 30 minutes if one is not provided. This protects
// against tests that hang and never finish.
if (!userConfig.globalTimeout) {
userConfig.globalTimeout = 1000 * 60 * 30; // 30 minutes
}

const overrides = {
use: {
headless: process.env.HEADLESS === 'true',
Expand Down
6 changes: 6 additions & 0 deletions src/sauce.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ for (const file of configFiles) {
}
}

// Set a default timeout of 30 minutes if one is not provided. This protects
// against tests that hang and never finish.
if (!userConfig.globalTimeout) {
userConfig.globalTimeout = 1000 * 60 * 30; // 30 minutes
}

const overrides = {
use: {
headless: process.env.HEADLESS === 'true',
Expand Down

0 comments on commit 62ed9ca

Please sign in to comment.