Repository navigation
test: build a large crew-log unit in groups, skip an unreported MCP wait - #36747
Conversation
The large-state savepoint test appended its filler one entry and one fsync at a time, and built its hex fixture in quadratic time; it now writes the same entries with append_many in groups and builds the hex in one pass. The real-backend consolidation tests waited out the 6 s no-report MCP drain on every start; the fake reports no server, so the ceiling is cut to 0.05 s through the session_handle facade.
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. This is a test-only speed-up: the filler entries and the code path under test stay the same, and the MCP drain ceiling is shortened through the facade that already mirrors it into Notes
[DESIGN-REVIEWED] 2365814 Description read[DESCRIPTION-READ] f6ff97f5ad8d48271c2a62393bbce3defeacdd3a56c53509184b159923f828bb That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approving. On head 2365814 the review checked that _MCP_DRAIN_NO_REPORT_CEILING is patched through the session_handle facade, which test_session_handle_bindings.py pins as reaching the owner and being undone. It also checked that the fake backend never sends an MCP report, so the old 6 s ceiling was pure waiting, and that the new _hex loop runs ceil(chars/64) times, so its output is byte-for-byte the same. Finally, it checked that append_many runs the same validation and writes the same types, data and seqs as one append per entry. The diff merges cleanly with #36730.
Done well: every filler size from 300 to 19,200 and every assertion stay as they were. The savings come only from grouping writes through the store's own API.
- Optional:
test/test_crew_log_slot_savepoint_large_state.py:124could call the existing_append_groupedhelper intest/crew_log_projection_helpers.pyinstead of keeping its own_FILLER_GROUPloop. That helper already has an equivalence test. - Optional: the comment near line 132 says these are "the same entries" an append each would write. In fact each group of 300 shares one time stamp. No assertion reads entry time, so this only affects the wording.
Problem / Motivation
Goal: Seven more slow tests take the same code path with less waiting or less fixture cost, saving about 105 s of test time per run with no check weakened.
The large crew-log savepoint test spent most of its time writing its fixture one fsync at a time. The real-backend consolidation tests waited out a 6 s MCP drain on every start, for a server the fake backend never reports.
Why it matters
Every PR runs these tests on every shard. Time spent building a fixture or waiting on a constant the test never asserts on buys no coverage.
Not a goal
src/change.test_crew_log_emit_continuity.pyis not changed; it is reported below as a finding for its owner.What changed (motivation → approach → change)
test/test_crew_log_slot_savepoint_large_state.pyappend_manyin groups of 300; the hex built in one passtest/test_consolidation_fresh_conversation.py_MCP_DRAIN_NO_REPORT_CEILING0.05 s, set through thesession_handlefacadeMeasured alone at
-n0. Every filler size (300, 1,200, 4,800, 19,200) is kept, and so is the real child process.Finding for the owner:
test_crew_log_emit_continuity.pytest_a_claim_does_not_take_back_a_pin_a_queued_closer_still_owes(20 s) claims its terminal event is queued, held behind a blocked writer, while a re-claim lands. In practice the writer runs that append inline on the test thread. A stack dump at 5 s showson_turn_completed→writer.submit→ the test's_held, all on the main thread. So_held'srelease.wait(20.0)runs out before the re-claim, itsassertraises inside the job, and the writer retains the failed entry.The re-claim therefore meets a closer that already failed and was retained, not one waiting in the queue. The test exercises the retained-after-failure path, not the queued path its docstring describes. Its 20 s is that wait running out. I did not check whether its mutation guard still turns red.
Backwards compatibility
Compatible: test-only change.
Removes nothing: no test, fixture or helper is removed; the collected test ids are identical before and after.
Tests
Proof: not provable -- test-only change
Planted bugs in
src/, each reverted after the run:crew_log/slot_state_codec.py)crew_log/checkpoint.py)llm_helpers_parts/background_turns.py)test_back_to_back_jobs_each_send_only_their_own_prompt_on_one_runtime,test_a_failed_new_conversation_falls_back_to_a_fresh_runtimeand four seam testsnew_conversationhas no reset fallbacktest_a_failed_new_conversation_falls_back_to_a_fresh_runtimeBoth files passed 10 times at
-n0, 5 times at-n 2besidetest_crew_log_slot_savepoint_growth.py, and once in reversed order. Flake-pattern, wait-discipline and facade-mirror guards pass; the short budget carries a# flake-ok:reason. flake8, isort, black, comment-history and brand checks pass.Looked at and left as they are:
test_taskq_admission_integration.py::test_2000_submissions_...rfc-overload-resilience.mdtest_crew_log_slot_savepoint_growth.py,..._seal_on_rollover.pytest_session_storage_empty_trash_removal.pydeep batchtest_kas_bundle_api.pyinstall testtest_remote_git_channel_bounds.py(10 s teardown)Manual verification
N/A — test-only change; the timings and planted-bug runs above are the verification.
Related Issues
Refs #25195
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.