You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: skills/testo-flaky-tests/SKILL.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ public function __construct(
67
67
) {}
68
68
```
69
69
70
-
-`times` is the **total** number of runs. `#[Repeat(times: 3)]` runs the test three times (mirrors Kotlin's `repeat(n)` and JUnit's `@RepeatedTest(n)`). It is **not** "additional repetitions on top of one run".
70
+
-`times` is the **total** number of runs. `#[Repeat(times: 3)]` runs the test three times. It is **not** "additional repetitions on top of one run".
71
71
-`maxFailures` defaults to `0` — any single failure fails the whole loop.
72
72
- Combining with `#[Retry]`: Repeat runs *inside* Retry — each retry attempt re-runs the full repeat cycle. Possible, but the semantics are subtle; surface it to the user before suggesting both.
73
73
@@ -91,7 +91,7 @@ Don't ship `#[Repeat(times: 50)]` long-term on a fast suite — CI cost adds up.
91
91
## Pitfalls
92
92
93
93
-**Don't disable `markFlaky`** on `#[Retry]` / `#[Repeat]` (it defaults to `true`). Setting `markFlaky: false` is **silent rot** — a flaky test that retries to green hides the underlying defect. Only flip it off when the user explicitly asks.
94
-
-**`Repeat(times: N)` is total runs, not extra runs.**`Repeat(times: 1)` runs the test once. People coming from older PHPUnit `@Repeat` semantics expect "additional" — they're wrong here.
94
+
-**`Repeat(times: N)` is total runs, not extra runs.**`Repeat(times: 1)` runs the test once, `Repeat(times: 3)` runs it three times total — `N` is the run count, not a number of *additional* runs on top of the first.
95
95
- Combining `#[Retry]` with `#[Repeat]` is allowed: Repeat runs **inside** Retry (each retry attempt re-runs the full repeat cycle). Only suggest both when the user genuinely wants that nesting.
96
96
- A test with `Expect::exception(...)` and `#[Retry]` is almost always wrong — expected exceptions are deterministic by design.
97
97
- Don't use retries to paper over network calls in unit tests — replace the dependency with a fake instead.
0 commit comments