Skip to content

Commit 2c8b75d

Browse files
committed
Tweak test timeouts to reduce flakiness
1 parent 52bbd5b commit 2c8b75d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/test-try-commit.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -547,12 +547,13 @@ test('try-commit fails when it exceeds its own timeout', async t => {
547547
test('try-commit refreshes the timeout on commit/discard', async t => {
548548
const ava = newAva();
549549
const result1 = await ava.cb(a => {
550-
a.timeout(100);
550+
// Note: Allow for long enough timeouts that the promise tasks execute in time.
551+
a.timeout(2e3);
551552
a.plan(3);
552-
setTimeout(() => a.try(b => b.pass()).then(result => result.commit()), 50);
553-
setTimeout(() => a.try(b => b.pass()).then(result => result.commit()), 100);
554-
setTimeout(() => a.try(b => b.pass()).then(result => result.commit()), 150);
555-
setTimeout(() => a.end(), 200);
553+
setTimeout(() => a.try(b => b.pass()).then(result => result.commit()), 1e3);
554+
setTimeout(() => a.try(b => b.pass()).then(result => result.commit()), 2e3);
555+
setTimeout(() => a.try(b => b.pass()).then(result => result.commit()), 3e3);
556+
setTimeout(() => a.end(), 4e3);
556557
}).run();
557558

558559
t.is(result1.passed, true);

0 commit comments

Comments
 (0)