Skip to content

Commit a03cd88

Browse files
author
DavertMik
committed
fixed flakiness of timeout tests
1 parent 7f77dc3 commit a03cd88

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

test/data/sandbox/configs/timeouts/suite_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Scenario('timeout test in 0.5 #second', { timeout: 0.5 }, ({ I }) => {
1212

1313
Scenario('timeout step in 0.5', ({ I }) => {
1414
I.limitTime(0.2).waitForSleep(100)
15-
I.limitTime(0.1).waitForSleep(3000)
15+
I.limitTime(0.2).waitForSleep(3000)
1616
})
1717

1818
Scenario('timeout step in 0.5 new syntax', ({ I }) => {
1919
I.waitForSleep(100, step.timeout(0.2))
20-
I.waitForSleep(3000, step.timeout(0.1))
20+
I.waitForSleep(3000, step.timeout(0.2))
2121
})

test/runner/timeout_test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ describe('CodeceptJS Timeouts', function () {
4040
})
4141

4242
it('should use global timeouts if timeout is set', done => {
43+
this.retries(3)
4344
exec(config_run_config('codecept.timeout.conf.js', 'no timeout test'), (err, stdout) => {
4445
debug_this_test && console.log(stdout)
4546
expect(stdout).toContain('Timeout 0.1')
@@ -51,7 +52,7 @@ describe('CodeceptJS Timeouts', function () {
5152
it('should prefer step timeout', done => {
5253
exec(config_run_config('codecept.conf.js', 'timeout step', true), (err, stdout) => {
5354
debug_this_test && console.log(stdout)
54-
expect(stdout).toContain('was interrupted on step timeout 100ms')
55+
expect(stdout).toContain('was interrupted on step timeout 200ms')
5556
expect(err).toBeTruthy()
5657
done()
5758
})

0 commit comments

Comments
 (0)