Skip to content

Commit b3d114e

Browse files
legapmjhenkesemilyrohrbough
authored
fix: add CYPRESS_VERIFY_TIMEOUT param and a test for it (#19282)
Co-authored-by: Matt Henkes <[email protected]> Co-authored-by: Emily Rohrbough <[email protected]>
1 parent 4a2aa8a commit b3d114e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

cli/lib/tasks/verify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const logger = require('../logger')
1515
const xvfb = require('../exec/xvfb')
1616
const state = require('./state')
1717

18-
const VERIFY_TEST_RUNNER_TIMEOUT_MS = 30000
18+
const VERIFY_TEST_RUNNER_TIMEOUT_MS = process.env.CYPRESS_VERIFY_TIMEOUT || 30000
1919

2020
const checkExecutable = (binaryDir) => {
2121
const executable = state.getPathToExecutable(binaryDir)

cli/test/lib/tasks/verify_spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ context('lib/tasks/verify', () => {
7272
expect(verify.VERIFY_TEST_RUNNER_TIMEOUT_MS).to.be.gt(10000)
7373
})
7474

75+
it('accepts custom verify task timeout', () => {
76+
process.env.CYPRESS_VERIFY_TIMEOUT = '500000'
77+
delete require.cache[require.resolve(`${lib}/tasks/verify`)]
78+
const newVerifyInstance = require(`${lib}/tasks/verify`)
79+
80+
expect(newVerifyInstance.VERIFY_TEST_RUNNER_TIMEOUT_MS).to.be.gte(500000)
81+
})
82+
7583
it('logs error and exits when no version of Cypress is installed', () => {
7684
return verify
7785
.start()

0 commit comments

Comments
 (0)