Repository navigation
Conversation
…gnostics Decouple the cancellation watcher shutdown event from the business cancellation event in test_cancellation_terminates_owned_service so cancel is set only after observing the round-2 install-entered marker, and never fabricated on watcher timeout or early screen exit. Attach structured diagnostics (watcher branch, cancel state, on-disk markers, top-level status/error, per-attempt stage/verdict summary, and full result dict) to the cancellation assertions, and add a deterministic unit test for the watcher and diagnostic summary. Agent-assisted-by: Antigravity (author) Signed-off-by: Zlatanwic <2353113@tongji.edu.cn>
Dong1017
left a comment
There was a problem hiding this comment.
LGTM
Posted by Dong-bot (review), an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced).
PR review verdict — PASS
Reviewed base 3845d9e and head 66df715 (full diff, single file: tests/harness/test_managed_box_search.py; no .github/ or product code touched).
Prior-review state: pr/prior-reviews.md shows no formal reviews on this head and no outstanding CHANGES_REQUESTED, so this Approve is the first formal review on this head.
Verified by reading the diff and the surrounding repo code:
_watch_install_markersetscancelonly when aninstall-enteredmarker is on disk. The old watcher calledcancel.set()unconditionally on its 15 s deadline, which could hide a missing marker. The new one returnswatcher_timeoutand leavescancelunset. The loop checksstop_watcherbefore the marker, so thescreen_finished_before_*outcomes are classified consistently.- The marker path matches what the fixture writes.
tests/fixtures/box_serving_protocol.pyL86-91 touchesreceipt_path.parent / "install-entered"in modestimeout/cancelled/lost_owner, then sleeps 20 s. Thesearch/*/install-enteredglob is the same one the original test used. Fixture stage timeouts are 10 s (campaign()), so a missing marker cannot hangscreen()now that the watcher no longer force-cancels. test_cancellation_terminates_owned_servicekeeps every original assertion (status,cleanup_verified, two attempts, "install did not settle", marker present). It adds a stricter check that the watcher triggered oninstall_enteredand thatcancelwas set.thread.join(timeout=5)plusassert not thread.is_alive()runs first, so a stuck watcher fails with diagnostics instead of hanging, andwatcher_stateis only read after the join succeeds.- The new unit test
test_cancellation_watcher_never_fabricates_cancel_without_markercovers all four watcher outcomes (timeout, stop before marker, stop after marker, match) and assertscancelstate for each. It also checks the_cancellation_diagnosticsshape against a synthetic result. The timings are small (0.02 s timeout, 0.005 s poll) and the checks are deterministic. _cancellation_diagnosticsreads results defensively with.get(...) or {}. It only builds a message for assertions, so it adds no production behavior or coupling.
Not verified here:
- I did not run the tests (no execution environment). I did not check CI status.
- The diagnostics embed the full
resultin assertion messages. Failure output can be large. This is an optional note, not a blocker.
This is a test-only change with no outstanding blocking findings. The Approve is one vote toward the repository's two-approval rule and does not alter merge eligibility.
|
Antigravity, acting for @Zlatanwic. @amy-why-3459 @zengchuang-hw — PR #1101 is now Ready for independent review on head Details: accepted scope, diff summary, and verification status
|
|
Posted by Dong-bot (review), an automated agent acting on behalf of @Dong1017 (always-on-bot, model auto-smart?optimize_for=balanced). role=review: My verdict on head Details
|
Bounty-hunter
left a comment
There was a problem hiding this comment.
LGTM
Claude Code agent, acting for @Bounty-hunter.
PR review verdict — PASS
Reviewed base 3845d9ee4e675267bbb68ef3ffa38a0f2916be71 and head 66df7156a41ea2f784fcd4a1d42538d9d2a7a015. Single file, tests/harness/test_managed_box_search.py; no product code and no .github/ change.
Independent evidence, read from the tree at this head:
- The defect the change addresses is real: the old watcher called
cancel.set()on its deadline unconditionally, so a missinginstall-enteredmarker was indistinguishable from a genuine cancellation._watch_install_markernow returnswatcher_timeoutwithcancelunset, and it checksstop_watcherbefore the marker, so an early finish is classified asscreen_finished_before_markerorscreen_finished_before_cancelinstead of fabricating a cancel. - Removing the unconditional
cancel.set()from the test'sfinallycannot hangscreen():campaign()setsstage_timeout_secondsto 10.0 for faultcancelled(tests/harness/test_managed_box_search.py:87-89), and the fixture touchesinstall-enteredand only then sleeps 20 s (tests/fixtures/box_serving_protocol.py:86-91). Without a marker the run now costs a bounded stage timeout and a loud assertion failure rather than a silent force-cancel. - The marker path is the one the fixture writes:
receipt_path.parent / "install-entered"under the campaign root, which is the samesearch/*/install-enteredglob the original test used. No path drift. test_cancellation_terminates_owned_servicekeeps every original assertion (status,cleanup_verified, two attempts, "install did not settle", marker present) and adds the watcher-state checks.thread.join(timeout=5)plusassert not thread.is_alive()runs beforewatcher_aliveandwatcher_stateare read, so a stuck watcher fails with diagnostics instead of hanging the suite.test_cancellation_watcher_never_fabricates_cancel_without_markercovers all four watcher outcomes (timeout, stop before marker, stop after marker, match) and asserts thecancelbit for each, plus the diagnostics shape against a synthetic result. The timings (0.02 s deadline, 0.005 s poll) are short and deterministic.
Not verified here: I did not execute the suite (no execution environment) and did not check CI status. Optional, non-blocking: _cancellation_diagnostics embeds the whole result in assertion messages, so a failure will print a large blob.
No actionable findings. This approval is one vote toward the repository's two-approval rule and does not change merge eligibility.
amy-why-3459
left a comment
There was a problem hiding this comment.
LGTM
inferRSI, acting for @amy-why-3459.
PR review verdict — PASS
Reviewed base 3845d9ee4e675267bbb68ef3ffa38a0f2916be71 and head 66df7156a41ea2f784fcd4a1d42538d9d2a7a015.
Verified the single-file test-only diff against the accepted #999 scope (comment 7405949760 / comment 7406566004): _watch_install_marker sets cancel only after search/*/install-entered, stop_watcher is separate from business cancellation (including teardown of test_cancellation_terminates_owned_service), existing assertions and the #997 stage timeouts (1.5s / 10.0s) are untouched, and test_cancellation_watcher_never_fabricates_cancel_without_marker covers the four watcher branches plus diagnostics.
declarations and knowledge-model-policy (Not applicable) are green on this head. I did not rerun the harness file locally. Ready CI (CI — ready / review lane) is action_required on this first-time-contributor fork PR and is not confirmed here. This review does not replace @Dong1017 goal acceptance.
No actionable findings.
zengchuang-hw
left a comment
There was a problem hiding this comment.
LGTM
dot, acting for @zengchuang-hw.
PR review verdict — PASS
Reviewed 3845d9ee4e675267bbb68ef3ffa38a0f2916be71 → 66df7156a41ea2f784fcd4a1d42538d9d2a7a015 against the accepted #999 test-only slice. The watcher now separates shutdown from cancellation; only observing the install marker sets cancel. Both original attempt/cleanup assertions and production timeouts are preserved, and failures carry the trigger, marker state and attempt diagnostics. No blocking code finding.
Independently ran the focused pytest case and repeated its four watcher branches and diagnostics 30 times. The local service-backed run could not qualify the cancellation path: this sandbox rejects Unix sockets, and both the cancellation and socket tests fail on base as well. The three clean Python 3.11 parallel runs are author-reported, not independently reproduced. The current Ready run reports action required; knowledge-model-policy passed. This verdict is on the test changes, not readiness to integrate or the old flake's root cause.
Delegation: exact-head review invitation · account zengchuang-hw · independent review of the #999 test-only slice.
Governing Issue and delivery slice
Refs #999
Anchors touched: none
@Dong1017) and assigned to@Zlatanwicwithstatus:accepted(comment 7406566004); accountable and goal-acceptance owner@Dong1017.tests/harness/test_managed_box_search.pyonly, no production code)stop_watcher) from business cancellation (cancel) via_install_entered_markersand_watch_install_marker:cancel.set()is called only after observingsearch/*/install-entered, recording trigger branch (install_entered,screen_finished_before_marker,screen_finished_before_cancel, orwatcher_timeout) and never fabricating cancellation without the marker._cancellation_diagnostics) totest_cancellation_terminates_owned_service: watcher trigger branch,watcher_alive,cancel_set,markers_on_disk, top-levelstatus/source/error/cleanup_error, per-attempt summary (index,path,failed_stage, per-stepid:status,verdict,reason,cleanup_verified), and the fullresultdict.status == "inconclusive",cleanup_verified is True,len(result["attempts"]) == 2,"install did not settle", andinstall-enteredpresence) and keeps fix(harness): retry ConnectionRefusedError during Box socket startup and stabilize test timeout #997's merged stage timeouts (1.5sfor timeout fault modes,10.0sfor other modes includingcancelled) unchanged.test_cancellation_watcher_never_fabricates_cancel_without_markercovering all four watcher paths and_cancellation_diagnostics.Knowledge authorship declaration
Changed artifacts and evidence
stop_watcherfromcancel; never fabricatecancel.set()withoutinstall-enteredtests/harness/test_managed_box_search.py(_install_entered_markers,_watch_install_marker,test_cancellation_terminates_owned_service,test_cancellation_watcher_never_fabricates_cancel_without_marker)66df7156: deterministic unit test1 passed(0.26s); 3×pytest -rs -n 4 tests/harness/test_managed_box_search.py(29 passedeach)tests/harness/test_managed_box_search.py(_cancellation_diagnostics,test_cancellation_terminates_owned_service)66df7156:ruff check src tests tools(All checks passed!); 3× parallel file runs (29 passedeach)Checks and dependencies
66df7156a41ea2f784fcd4a1d42538d9d2a7a015(basemain3845d9ee):ruff check src tests tools(Linux Python 3.11.15, repo root):All checks passed!pytest -q tests/repository/test_smoke.py tests/contracts/test_claim.py(Linux Python 3.11.15, repo root):8 passedpytest -vv -k test_cancellation_watcher_never_fabricates_cancel_without_marker tests/harness/test_managed_box_search.py(Linux Python 3.11.15):1 passed, 28 deselected in 0.26spytest -rs -n 4 tests/harness/test_managed_box_search.py(Linux Python 3.11.15, xdist 3.8.0):29 passed, 24 warnings in 23.65s29 passed, 24 warnings in 23.71s29 passed, 24 warnings in 23.47sfull-checkon Python 3.10 / 3.11,pr-references,knowledge-model-policy): not yet run (pending PR creation and promotion to Ready).pytest tests/harness/test_managed_box_search.py: skipped by file-levelpytestmark(os.name != "posix" or not hasattr(socket, "AF_UNIX")).main3845d9ee(after bug: intermittent Box search startup failure in _AttachedLab.start and test_managed_box_search #996 / PR fix(harness): retry ConnectionRefusedError during Box socket startup and stabilize test timeout #997 merged at1a6d34fd); zero overlapping edits with fix(harness): retry ConnectionRefusedError during Box socket startup and stabilize test timeout #997.Remaining work and Issue closure
66df7156; if the single-attempt failure ever recurs in Ready CI, retain the failed job and structured attempt diagnostics.@Dong1017(per comment 7405949760).