anthonyoteri / anthonyoteri/cargo-rigtest
Transient-only retry policy (retry infra failures, never assertions)
- Vorherrschende Sprache
- Rust
- Sterne
- 0
- Forks
- 0
- Ø Merge
- 3 T. 18 Std.
- Gemergte PRs (30 T.)
- 8
Beschreibung
## Problem
`retries = N` retries on *any* failure, which can mask a real assertion bug. `retry_on_error = ` avoids that but requires threading typed error variants through the test signature. The common need — "retry only on transient infra errors (connection reset / timeout), never on an assertion failure" — is verbose to express.
## Proposal
A built-in transient-only retry mode:
```rust
#[testcase(retries = 2, retry_on = transient)]
async fn t(ctx: Arc) -> Result<(), rigtest::Error> { Ok(()) }
```
- `retry_on = transient` retries on setup-phase failures / a provided error predicate, and **never** on assertion panics.
- Optionally allow registering a global "is this error transient?" classifier for the suite.
## Why
Makes flaky-infra resilience a one-liner without risking a masked regression — assertion failures stay loud, transient blips self-heal. Report the retry count per case so flakiness stays visible.
Beitragsleitfaden
Rechercherichtung
Trace the existing #[testcase] handling for retries and retry_on_error, including how setup errors and assertion panics are distinguished. Define and test transient-only behavior so matching setup failures retry, assertion panics never do, and each case reports its retry count; also resolve whether suite-wide classification is required.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust
- Bereich
- testing
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100