anthonyoteri / anthonyoteri/cargo-rigtest
Transient-only retry policy (retry infra failures, never assertions)
- 主要语言
- Rust
- 星标
- 0
- 派生
- 0
- 平均合并
- 3 天 18 小时
- 30 天内合并 PR
- 8
描述
## 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.
贡献指南
调研方向
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.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- rust
- 领域
- testing
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100