Repository navigation
Conversation
The failed-holds-settlement test restarted a second service while the first still had a supervised _persist_soon write in flight. Since #44935 a load verifies each row against the gateway's digest record, so a load that read the store before that write's rename and the digest record after its compaction held the live row stopped as unverified_row. A real restart drains those writes in shutdown first; the test now does too.
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this is a test-only change that waits for the first service's detached write before the restart, the same drain Notes
[DESIGN-REVIEWED] 39a5f6f Description read[DESCRIPTION-READ] 8598f4877b479f9112c2729cfdf941aed797027a6775ea05a9f7e075e73e59b0 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: |
|
CI proof on head 39a5f6f: Backend Tests (3.12, 7) is green. That shard runs The one red, Backend Tests (Windows) (7), fails |
|
Superseded by #45124 (merged 22:42Z by @bolichen97). It drains the same detached |
Problem / Motivation
Goal: Turn main green again by making the failed-holds-settlement restart test wait for the first service's pending write before it restarts.
Main is red at ec12d79 on Backend Tests (3.12, 7) and Backend Tests (Windows) (6). Both fail the same test:
Why it matters
Every PR whose CI runs this file is red until main is fixed.
Not a goal
_loadsafe against a concurrent writer in another instance on the same directory. Flagged to @bolichen97 in main red: autonudge restart test loads its row as unverified_row after #44935 #45072.What changed (motivation → approach → change)
Decision: (A) the check is right; the test was wrong. No production change.
store_loader.py:929(if row_digest(raw) not in recorded: _hold_unverified_row(loop)).store.py:248-253writes the digest record as a superset before the store rename, andstore.py:284-288compacts it to the new rows after the rename.service._timer(...). That tick leaves a supervised detached write from_persist_soon(autonudge.py:1278, held in_inflight_adds). The test then built a secondAutoNudgeServiceon the same directory while that write was still running.autonudge.jsonbefore that write's rename (row digest2ead86…). It read the digest record after the compaction (onlycd0d18…). So the live row loaded asunverified_row.shutdown()drains them first. The test now awaitsservice._inflight_addsright after the tick, before it reads the store or restarts.Every assertion is kept: one snapshot write, no
expired, memory/store/restart allactive=Truewithterminal_delivered == "success", then the retry settles.Backwards compatibility
Compatible: test-only change.
Removes nothing: the diff adds one await in one test.
Tests
test_MUTATION_a_failed_holds_settlement_write_keeps_memory_store_and_restart_agreednow drains the first service's detached writes before reading the store and restarting.Proof: not provable -- test-only change
Manual verification
N/A — test-only change; CI runs the file.
Real-machine verification
N/A -- the diff changes one test and runs no product code. CI shard evidence will be added in a comment.
Related Issues
Fixes #45072
Sibling sweep
Swept: git grep -lE "AutoNudgeService(base_dir=tmp_path" -- test/ | xargs grep -l restart
Sibling: test/test_autonudge_shutdown_terminal_reprobe.py -- changed here
Siblings: none -- run 46485804677 on the first main commit with #44935 ran every backend shard and only this test failed
Pattern harvest
Rule candidate: review-prompt
Pattern: a test that builds a second service on the same store dir must drain the first one's detached writes (or shut it down) before the second one loads.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commitsContribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.