Skip to content

Commit 4f2c1ed

Browse files
ci: run Wrangler e2e tests twice to reduce flakes (#9287)
1 parent 1e93ebc commit 4f2c1ed

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

tools/e2e/runIndividualE2EFiles.ts

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,31 @@ for (const file of e2eTests) {
2626
}
2727
}
2828

29+
const failed: string[] = [];
30+
2931
for (const [file, task] of tasks.entries()) {
3032
console.log("::group::Testing: " + file);
31-
execSync(task, {
32-
stdio: "inherit",
33-
});
33+
try {
34+
execSync(task, {
35+
stdio: "inherit",
36+
});
37+
} catch {
38+
console.error("Task failed - retrying");
39+
try {
40+
execSync(task, {
41+
stdio: "inherit",
42+
});
43+
} catch (e) {
44+
console.error("Still failed, moving on");
45+
failed.push(file);
46+
}
47+
}
3448
console.log("::endgroup::");
3549
}
50+
51+
if (failed.length > 0) {
52+
throw new Error(
53+
"At least one task failed (even on retry):" +
54+
failed.map((file) => `\n - ${file}`)
55+
);
56+
}

0 commit comments

Comments
 (0)