Skip to content

test: realign intake tests with the routes master now runs - #5817

Merged
Sinity merged 2 commits into
masterfrom
fix/master-intake-tests
Sep 29, 2026
Merged

Sinity merged 2 commits into
masterfrom
fix/master-intake-tests

Conversation

@Sinity

@Sinity Sinity commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Four intake tests failed on master at 1beb2e5. Each encoded a route or contract that an earlier PR had changed. None is a production bug, so this PR changes tests only. One sibling guard that could never fire is tightened too.

Problem (evidence)

I reproduced the failures in one focused job over the four files (agentctl job 2555) and diagnosed them with probe tests that were not committed (including jobs 2635 and 2660). All four failures are deterministic, not load-related.

  • test_page_admission_runs_lease_free_owners_outside_the_writer_gate: admit_page returned RETRYABLE with CursorAuthorityBlockedError: ... global raw existence is unproven: required source or index tier is unavailable. The fixture created only index.db. The cursor-authority gate added in fix(storage): bound live frontier admission with journals #5657 fails closed when one tier exists without the other, which is the intended behavior.
  • test_watcher_queues_behind_daemon_maintenance_writer: the test paused LiveParseStage.warm. The batch has called only warm_paths since feat: Complete bounded intake and daemon-owned surfaces #5550, so the pause never happened and parser_started.wait(5.0) timed out.
  • test_dispatcher_page_compaction_cost_is_one_scoped_hold_at_archive_scale: each page traced 4 SELECTs instead of 3. The fourth is SELECT identity FROM schema_identity WHERE tier = 'index', which every validated read-only open has run since fix: Codex review debt: surfaces (51 findings) #5727. The three authority reads are unchanged.
  • test_flag_on_prefetch_and_flag_off_produce_identical_archive_content: the snapshots differ in raw_sessions, raw_revision_heads and raw_authority_parser_census.

Solution

  • Lease-free owners test: bootstrap a whole archive with initialize_active_archive_root, and put the source under its own root.
  • Maintenance-queueing test: pause warm_paths, the method the batch calls in _ingest_full_paths. Replace the 5 s and 1 s wall-clock waits with waits on the events themselves: an asyncio.Event set with call_soon_threadsafe, plus the maintenance-entered event. A finally releases the parked thread. pytest-timeout bounds a hang.
  • Compaction-cost test: separate the per-open identity read. Assert there is exactly one, which means the page used one connection, then keep the three-authority-read assertions. Raise the hang guard to 600 s, the same as its sibling measurement test: in one probe run under host load (average about 22), the 120 s default fired during seeding.
  • Delete the prefetch equivalence test and the helpers only it used. polylogue-fhlo1 tracks deleting or rewiring the dead DaemonParseStage and LiveParseStage.warm routes.
  • Sibling: test_page_admission_acquires_source_without_reading_unavailable_index forbade warm, which production never calls. The batch also swallows prewarm exceptions, so a raising stub would have passed anyway. The test now records calls to warm_paths and asserts there were none.

No production file changes, so the derived-identity closure is untouched.

Verification

  • agentctl job start polylogue pytest_focused --workspace /realm/worktrees/polylogue-mh-intake --wait -- tests/unit/sources/test_live_batch_convergence.py tests/unit/sources/test_live_watcher_locking.py tests/unit/daemon/test_dispatcher_intake_measurement.py tests/unit/daemon/test_raw_materialization_parse_stage_equivalence.py tests/unit/sources/test_live_watcher.py::test_page_admission_acquires_source_without_reading_unavailable_index (job 2688, head d81534d): devtools test: PASSED exit=0 diagnosis=pytest_passed, 21/21.
  • agentctl job start polylogue verify_quick --workspace /realm/worktrees/polylogue-mh-intake --wait (job 2696, head d81534d): verify: PASSED exit=0.

Self-review

  • Siblings. I searched tests/ for patches of the unused warm. One other guard patched it; it is fixed here. The remaining stage.warm(...) calls in test_parse_prefetch.py and test_live_watcher_parse_stage_equivalence.py test the dead classes directly and belong to polylogue-fhlo1.
  • Fix itself. The identity filter matches only from schema_identity, and it asserts exactly one match, so an extra connection per page still fails the test. The authority-read assertions are unchanged.
  • Anti-vacuity.
    • Maintenance queueing: wrapping the page in coordinator.run blocks maintenance, so maintenance_entered never sets and pytest-timeout fails the test.
    • Lease-free owners: the owner-outside-gate assertions are unchanged.
    • Derived-only guard: removing the _source_tier_acquisition_required() gate records a call.
  • Interruption. The parked parse thread is released on every exit from the wait block, so a failing run does not leave a thread blocking executor shutdown.
  • Waits. The only wall-clock bounds left in the changed tests are coordinator.shutdown(timeout=1.0) after all tasks finish, which was already there, and the pytest-timeout marks.
  • Public boundary. Synthetic fixtures only.
  • Docs. docs/design/convergence-simplification-inventory.md still cites the deleted equivalence test. That design note describes the dead route as a whole, so it is left to polylogue-fhlo1.

Residuals

  • In one repro job under load, the deleted test's seeding hung for 120 s in BlobPublicationReservationStore.reserve_many at conn.close(). Sibling tests in that file use the same seeding and passed. I did not reproduce it again.
  • tests/unit/daemon/test_daemon_cli.py load-sensitivity did not show up in my runs, so it is not addressed here.

🤖 Generated with Claude Code

https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg

Sinity and others added 2 commits September 29, 2026 11:34
- Live page admission: give the lease-free-owner test a whole archive.
  The cursor-authority gate from #5657 proves raw existence over the
  source and index tiers, and a lone index.db was refused as retryable.
- Watcher maintenance queueing: pause `LiveParseStage.warm_paths`, the
  batch's actual off-writer preparation since #5550, instead of the
  unused in-memory `warm`, and wait on events rather than 1-5 s clocks.
- Dispatcher compaction cost: count the per-open derived schema
  identity read (#5727) separately; the page still makes exactly three
  authority reads on one connection. Raise its hang guard to 600 s.
- Delete the flag-on/flag-off prefetch equivalence test. It drove
  `DaemonParseStage` and `backfill(prefetch_cache=...)`, which no
  production route constructs or populates; polylogue-fhlo1 owns that
  dead route.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
The degraded catch-up test forbade `LiveParseStage.warm`, which the batch
has not called since #5550, so the guard could never fire. Record calls
to `warm_paths` instead; the batch swallows a prewarm exception, so an
empty call list is asserted after the page.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-29T09:46:32.955951Z d81534d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Sinity
Sinity enabled auto-merge (squash) September 29, 2026 09:43
@Sinity
Sinity merged commit 6313fe8 into master Sep 29, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the fix/master-intake-tests branch September 29, 2026 09:48
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