fix: unbreak unit suite — stale persist stubs and expression-index drift flapping - #2
Open
Eliebibs wants to merge 1 commit into
Open
Conversation
…ift flapping The 20260715 session-time index migration broke the unit slice two ways: 1. LoadBalancer._persist_selection_state grew a skip_account_ids kwarg, but seven monkeypatched stubs in test_proxy_load_balancer_refresh.py kept the old signature. Callers pass the kwarg unconditionally, so every affected test raised TypeError inside select_account — and two (the event- synchronized ones) hung the whole suite waiting on events the dead task never set, killing the run via faulthandler before pytest could even print a summary. Stubs now accept and forward the kwarg and return the stale-id set like the real method. 2. idx_logs_session_time is expression-based (requested_at DESC), which alembic 1.18.4 reflects with an "approximate signature" on SQLite instead of skipping, so check_schema_drift flapped a phantom remove/add_index pair. The index is now registered in _MANUAL_DRIFT_INDEX_REQUIREMENTS (same convention as the other expression indexes, so presence is still asserted) and autogen index diffs for manually-verified indexes are ignored. make test-unit: 3114 passed. The two remaining failures (test_public_release_docs) are release-docs gates over in-flight openspec/changes content, left to the maintainer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011WtCWRvgq9Vivf3UJLaNsn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running
make test-uniton a fresh clone atba3d4c2c(macOS, Python 3.13.11, locked deps) fails: 3 schema-drift tests fail, and the LB-refresh concurrency tests TypeError/hang so hard that faulthandler kills the run before pytest prints a summary. Two independent causes, both introduced around the 2026-07-15 session-time index work:1. Stale
_persist_selection_statestubs. The method grew askip_account_idskwarg that callers pass unconditionally, but seven monkeypatched stubs intest_proxy_load_balancer_refresh.pykept the old signature. Every affected test raisedTypeErrorinsideselect_account; the two event-synchronized ones (test_select_account_does_not_clobber_concurrent_error_state,test_select_account_retries_no_accounts_after_runtime_recovery) then deadlocked the suite waiting on events the dead task never set. Stubs now accept/forward the kwarg and return the stale-id set like the real method.2. Expression-index drift flapping.
idx_logs_session_timeusesrequested_at DESC, which alembic 1.18.4 reflects on SQLite with an approximate signature (alembic.ddl.implwarning) rather than skipping, socheck_schema_driftreports a phantomremove_index/add_indexpair and the three drift tests fail their== ()assertions. Fixed following the repo's existing convention: the index is registered in_MANUAL_DRIFT_INDEX_REQUIREMENTS(so its presence is still asserted manually) and autogen index diffs for manually-verified indexes are ignored in_is_ignored_schema_drift.After this change
make test-unitreaches the end: 3114 passed, 39 skipped. The only remaining failures are the twotest_public_release_docsgates over in-flightopenspec/changes/content (add-rate-limit-reset-redemption,fix-usage-summary-log-hydration,add-stall-forensics-loop-lagmissing spec deltas / PR-head-gate task lines) — that's maintainer-side content I didn't want to invent, so it's left alone.🤖 Generated with Claude Code
https://claude.ai/code/session_011WtCWRvgq9Vivf3UJLaNsn