Skip to content

Commit 7959d95

Browse files
antonisclaude
andcommitted
fix(e2e): Add per-flow retries to handle Tart VM timing flakiness
The warm-up flow helps but doesn't fully eliminate first-launch timing issues on Cirrus Labs Tart VMs. On especially slow boots, the warm-up itself can fail and the first few flows fail before the simulator stabilises. Retry each flow up to 3 times to handle this. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 41a7f1c commit 7959d95

1 file changed

Lines changed: 21 additions & 11 deletions

File tree

dev-packages/e2e-tests/cli.mjs

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -317,21 +317,31 @@ if (actions.includes('test')) {
317317
// Running all flows via `maestro test maestro` shares a single runner
318318
// session — if one flow (e.g. crash.yml) kills the app, subsequent flows
319319
// fail because Maestro's XCTest driver loses the connection.
320+
// Retry failed flows up to 3 times — Tart VMs have transient first-launch
321+
// timing issues where the app isn't ready when Maestro connects.
322+
const maxAttempts = 3;
320323
const failed = [];
321324
try {
322325
for (const flowFile of flowFiles) {
323-
try {
324-
execFileSync('maestro', [
325-
'test', `maestro/${flowFile}`, ...maestroEnvArgs,
326-
'--debug-output', 'maestro-logs',
327-
'--flatten-debug-output',
328-
], {
329-
stdio: 'inherit',
330-
cwd: e2eDir,
331-
});
332-
} catch (error) {
333-
failed.push(flowFile);
326+
let passed = false;
327+
for (let attempt = 1; attempt <= maxAttempts && !passed; attempt++) {
328+
try {
329+
execFileSync('maestro', [
330+
'test', `maestro/${flowFile}`, ...maestroEnvArgs,
331+
'--debug-output', 'maestro-logs',
332+
'--flatten-debug-output',
333+
], {
334+
stdio: 'inherit',
335+
cwd: e2eDir,
336+
});
337+
passed = true;
338+
} catch (error) {
339+
if (attempt < maxAttempts) {
340+
console.warn(`Flow ${flowFile} failed (attempt ${attempt}/${maxAttempts}), retrying…`);
341+
}
342+
}
334343
}
344+
if (!passed) failed.push(flowFile);
335345
}
336346
} finally {
337347
// Always redact sensitive data, even if the test fails

0 commit comments

Comments
 (0)