Commit 476d6f9
fix(test_audit_citations): tolerate transient network tracebacks
`test_cli_runs_without_crash_on_empty_tree` failed on the
9d16720 GitHub Actions run with:
TimeoutError: The read operation timed out
The docstring already says exit codes 0/1/2 are acceptable to cover
"soft failure (rate limit, network) — acceptable", because the
auditor resolves roots relative to its REPO_ROOT constant (not cwd),
so even an empty `tmp_path` tree triggers live arXiv / Crossref calls
against the real repo's src/ and docs/. But the test's blanket
`assert "Traceback" not in result.stderr` contradicted that intent —
Python's default handler prints a traceback for any uncaught network
exception, which the auditor doesn't wrap in its top-level try/except.
Fix: only fail on a traceback whose tail names something OTHER than
a known transient network failure (TimeoutError, URLError, HTTP 429
/ 503 / 504, ConnectionReset, socket.timeout, ssl.SSLError). A real
crash (KeyError, AttributeError, etc.) still fails the test.
This is a test-only change. The auditor itself is unchanged.
Local: 32/32 auditor tests pass (including the previously-flaky one).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9d16720 commit 476d6f9
1 file changed
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
391 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
392 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
393 | 409 | | |
394 | 410 | | |
395 | 411 | | |
| |||
0 commit comments