Skip to content

Commit bb04294

Browse files
authored
chore(tests): Fix retry logic to throw error on last attempt
1 parent fc8e75a commit bb04294

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/canary/canary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async function retry(fn, attempts = 3) {
7676
try {
7777
return await fn();
7878
} catch (error) {
79-
if (i === attempts) throw error;
79+
if (i === attempts-1) throw error;
8080
console.log(`Retry ${i + 1}/${attempts} failed, retrying...`);
8181
await new Promise((resolve) => setTimeout(resolve, 2000));
8282
}

0 commit comments

Comments
 (0)