Commit 887a0d0
authored
[Scout][CI] Retry only failed specs on lane retry (#274844)
## Summary
On a Buildkite retry, re-run only the Scout spec files that failed
instead of the whole config.
Today, when a single spec fails, the entire config is marked failed and
stored in build metadata, so a retry re-runs everything. That slows CI
feedback and holds agents longer than needed. Closes
elastic/appex-qa-team#858.
## How it works
- After a config fails, parse the failed spec files from Playwright's
JSON report and upload them as a build-scoped, per-config artifact,
stamped with the attempt that produced it.
- On retry, restore the snapshot from the immediately-preceding attempt
and re-run only those spec files (passed as positional filters). Any
miss falls back to re-running the whole config.
- The attempt stamp handles the agent-lost case: if the previous attempt
was lost before it could snapshot, there is nothing to restore for that
attempt, so we safely re-run the whole config rather than trusting a
stale snapshot.
## Notes
- Retry unit is the spec **file** plus its server config (a spec can
pass under one server config and fail under another). Re-running whole
files also keeps `describe.serial` blocks intact, since their cases
share state and must run together.
## Verified in CI
Validated end-to-end in build
[#459089](https://buildkite.com/elastic/kibana-pull-request/builds/459089)
(both core cases observed on real lanes):
**1. Real test failure → only the failed spec file re-runs.** Lane #14
failed on the first attempt; the retry restored the snapshot
(`hosts/hosts_flyout.spec.ts`) and re-ran only that file (`Retrying 1
failed spec file(s)` → `8 passed`), not the whole `infra` config.
<img width="844" height="664" alt="Screenshot 2026-06-25 at 10 11 16 AM"
src="https://github.com/user-attachments/assets/3ff092be-0de9-4bfe-8bfc-44ea71548d13"
/>
**2. Agent lost → safe whole-config fallback.** Lane #58's first attempt
was lost (exit -1) before it could snapshot, so the retry found nothing
to restore and re-ran the whole config (`whole config will re-run` →
`Running:`) instead of trusting stale data.
<img width="742" height="507" alt="Screenshot 2026-06-25 at 10 15 46 AM"
src="https://github.com/user-attachments/assets/c601ef29-3dc1-4300-b3cf-d491d02bf96c"
/>1 parent 06f94ca commit 887a0d0
1 file changed
Lines changed: 78 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
39 | 104 | | |
40 | 105 | | |
41 | 106 | | |
| |||
144 | 209 | | |
145 | 210 | | |
146 | 211 | | |
147 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
148 | 221 | | |
149 | 222 | | |
150 | 223 | | |
| 224 | + | |
151 | 225 | | |
152 | 226 | | |
153 | 227 | | |
| |||
158 | 232 | | |
159 | 233 | | |
160 | 234 | | |
| 235 | + | |
| 236 | + | |
161 | 237 | | |
162 | 238 | | |
163 | 239 | | |
| |||
184 | 260 | | |
185 | 261 | | |
186 | 262 | | |
| 263 | + | |
187 | 264 | | |
188 | 265 | | |
189 | 266 | | |
| |||
0 commit comments