Skip to content

Size the recovery-test time budgets for slow CI runners (flake fix, tests only) - #107

Merged
seathatflowsinourveins merged 2 commits into
mainfrom
claude/recovery-test-timing-20260923
Sep 23, 2026
Merged

seathatflowsinourveins merged 2 commits into
mainfrom
claude/recovery-test-timing-20260923

Conversation

@seathatflowsinourveins

Copy link
Copy Markdown
Owner

Summary

  • Fixes intermittent hosted-CI failures in tests/test_adaptive_paper_recovery.py. Two tests hit 'needs_attention' != 'passed': test_admission_freeze_does_not_block_confirmed_owned_exit (seen on Require the promotion-gate result to report every named gate check (SYN) #77) and test_partial_buy_cancel_then_exact_nine_decimal_exit_after_expired_trial (seen on Let catalog-freshness open a reviewable, off-by-default evidence PR #95, reported by a peer session).
  • Cause: the test's fake port publishes a single SPY quote at start(), and the fixture set quote_max_age_seconds = 0.05. Recovery requires a fresh quote before the owned exit, and the snapshot and ledger writes in between can take longer than 50 ms on a slow CI disk. The quote then goes stale, recovery_quote_not_fresh is raised, and the result is needs_attention.
  • Reproduced deterministically by injecting an 80 ms delay into the fake snapshot. With the old budgets both tests fail (2/2); with the new budgets both pass (0/2).
  • Fix (test fixture only; engine code unchanged): the fixture now allows a 1 s quote age and a 3 s recovery deadline. The deadline test sets its own 1 s budget. The 30-second-stale quote case still fails as intended.

Evidence

  • tests.test_adaptive_paper_recovery: 21 OK under both interpreters.
  • python3 -m unittest: 2624 OK (330 skipped).
  • validate.py, validate_catalogs.py, trading_gates.py --check, evidence_manifest.py --check and build_ecosystem.py --check all rc=0.
  • Guarded gitleaks: no leaks.

🤖 Generated with Claude Code

Two RecoveryTests (admission-freeze owned exit; partial buy cancel then
nine-decimal exit) failed intermittently in hosted CI with needs_attention:
the fake port publishes one quote at start and the fixture allowed it 50 ms
of freshness, which the snapshot/ledger writes before the exit can exceed on
slow disks. Reproduced deterministically by injecting an 80 ms snapshot
delay (old budgets: 2/2 fail; new: 0/2). The fixture now allows 1 s quote
age and a 3 s recovery deadline; the deadline test keeps its 1 s budget and
the 30 s-stale quote case still fails. Engine code is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@seathatflowsinourveins
seathatflowsinourveins merged commit 7c6037f into main Sep 23, 2026
13 checks passed
@seathatflowsinourveins
seathatflowsinourveins deleted the claude/recovery-test-timing-20260923 branch September 23, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant