Skip to content

Commit 9e5f8b0

Browse files
committed
refactor(workers): extract default workers timeout into named constant
Address review feedback on #5545: replace the magic literal `600000` in `_getWorkersTimeoutMs()` with a module-level `WORKER_TIMEOUT_MINUTES` constant and an explicit `* 60 * 1000` conversion, so the default value reads as "10 minutes" at the call site. No behavior change — default still resolves to 600000 ms.
1 parent a1d8166 commit 9e5f8b0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/workers.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import { createRuns } from './command/run-multiple/collection.js'
2727

2828
const pathToWorker = path.join(__dirname, 'command', 'workers', 'runTests.js')
2929

30+
const WORKER_TIMEOUT_MINUTES = 10
31+
3032
const initializeCodecept = async (configPath, options = {}) => {
3133
const config = await mainConfig.load(configPath || '.')
3234
const codecept = new Codecept(config, { ...options, skipDefaultListeners: true })
@@ -518,7 +520,7 @@ class Workers extends EventEmitter {
518520
if (Number.isFinite(envTimeout)) return envTimeout
519521
const configTimeout = this.codecept?.config?.workersTimeout
520522
if (Number.isFinite(configTimeout)) return configTimeout
521-
return 600000
523+
return WORKER_TIMEOUT_MINUTES * 60 * 1000
522524
}
523525

524526
async run() {

0 commit comments

Comments
 (0)