Skip to content

Commit 5c35788

Browse files
pncclaude
andcommitted
Document CI failure reproduction workflow in CLAUDE.md
Add a section explaining how to reproduce CI failures locally by forcing TCG mode with QEMU_ACCEL=tcg, and the expected reproduce → fix → verify → full suite workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent dbe2018 commit 5c35788

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@ uv run pytest tests/test_e2e.py -v -s
1616

1717
The test boots the VM end-to-end (takes ~90s without KVM) and verifies `curl https://pypi.org` works through mitmproxy. Do not commit if this fails.
1818

19+
### Fixing CI failures
20+
21+
When a test fails in CI but passes locally, **reproduce the failure locally
22+
before applying a fix.** This VM has KVM, but CI may not — one known
23+
divergence is the QEMU CPU model (`-cpu host` with KVM vs `-cpu max` with
24+
TCG). To match CI's TCG environment:
25+
26+
```bash
27+
QEMU_ACCEL=tcg uv run pytest tests/test_e2e.py::test_that_failed -v -s
28+
```
29+
30+
The workflow is:
31+
32+
1. **Reproduce** — run the failing test under CI-like conditions and confirm it fails.
33+
2. **Fix** — apply the change.
34+
3. **Verify** — re-run under the same conditions and confirm it passes.
35+
4. **Full suite** — run the complete test suite to check for regressions.
36+
1937
The full suite including the network isolation tests can take 5+ minutes under TCG emulation. TCG is slower than KVM but not *that* slow — if cloud-init status is unchanged for more than a minute, check the console log and process list rather than assuming it's just slow. A dead QEMU process or OOM kill is more likely than TCG being the bottleneck.
2038

2139
Launch the test with `Bash` using `run_in_background: true`, then immediately attach a `Monitor` to tail the output file with a progress filter. This keeps the conversation unblocked while streaming results:

0 commit comments

Comments
 (0)