From d2a0a3242e657137c12669b075de92c5f455afbb Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Thu, 5 Nov 2026 11:20:11 +0100 Subject: [PATCH] Flaky-test policy: doctest quarantine and nextest's SLOW lines --- AGENTS.md | 7 ++++--- CLAUDE.md | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 5663dffd42..a1396fd0e3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -126,9 +126,10 @@ of it. - Never commit media: test images are procedural (`lightcraft-scenes`) or CC0 downloads in the gitignored `corpus/`. - **Flaky tests:** a test that fails, then passes on a rerun of the same commit, is flaky. Don't rerun until it passes and move on: open an issue with the failing log, and if it failed on two unrelated PRs, quarantine it with - `#[ignore = "flaky: #"]` in a PR of its own until the issue is fixed. Never quarantine a test that fails - every time; fix the code or the test. A test that hangs is a failure too: libtest's "has been running for over - 60 seconds" line names it. + `#[ignore = "flaky: #"]` (a doctest: an `ignore` code fence and a comment naming the issue) in a PR of its + own until the issue is fixed. Never quarantine a test that fails every time; fix the code or the test. A test that + hangs is a failure too: under `cargo test`, libtest's "has been running for over 60 seconds" line names it; under + nextest (`LIGHTCRAFT_NEXTEST=1`), its `SLOW` lines do. - A test that can't run here (no GPU, corpus file, craft-fonts face, model) calls `lightcraft_testkit::skip!(Gpu, "why")` before it returns, not a bare `eprintln!`. `cargo xtask ci` then lists the skips and the machine's GPU adapters and data, and writes `target/ci/report.json` and `target/ci/summary.md` (Markdown for a PR). diff --git a/CLAUDE.md b/CLAUDE.md index be796d9d44..209c73159f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -140,9 +140,10 @@ of it. - Never commit media: test images are procedural (`lightcraft-scenes`) or CC0 downloads in the gitignored `corpus/`. - **Flaky tests:** a test that fails, then passes on a rerun of the same commit, is flaky. Don't rerun until it passes and move on: open an issue with the failing log, and if it failed on two unrelated PRs, quarantine it with - `#[ignore = "flaky: #"]` in a PR of its own until the issue is fixed. Never quarantine a test that fails - every time; fix the code or the test. A test that hangs is a failure too: libtest's "has been running for over - 60 seconds" line names it. + `#[ignore = "flaky: #"]` (a doctest: an `ignore` code fence and a comment naming the issue) in a PR of its + own until the issue is fixed. Never quarantine a test that fails every time; fix the code or the test. A test that + hangs is a failure too: under `cargo test`, libtest's "has been running for over 60 seconds" line names it; under + nextest (`LIGHTCRAFT_NEXTEST=1`), its `SLOW` lines do. - A test that can't run here (no GPU, corpus file, craft-fonts face, model) calls `lightcraft_testkit::skip!(Gpu, "why")` before it returns, not a bare `eprintln!`. `cargo xtask ci` then lists the skips and the machine's GPU adapters and data, and writes `target/ci/report.json` and `target/ci/summary.md` (Markdown for a PR).