Repository navigation
test: control asyncio timing and own harness cleanup - #838
AlexanderZ-Band merged 13 commits into
Conversation
AlexanderZ-Band
left a comment
There was a problem hiding this comment.
my-code-review --fix: one cycle converged with no verified findings. Reviewed the controlled-time harness, exceptional cleanup ownership, approval budget coverage, watchdog boundaries, retention callback ordering, and development dependency changes. Simplify found no behavior-preserving cleanup to apply. No existing unresolved review feedback required disposition.
AlexanderZ-Band
left a comment
There was a problem hiding this comment.
my-code-review --fix: final full-diff review converged with no verified findings. Rechecked reusable task ownership, AdapterOwner cleanup after a backend-close failure, declarative approval scenarios, controlled timer boundaries, ACP real-wire failure cleanup, and retention reporting order. The additional teardown failure probe is covered by a regression. All 22 targeted cases pass; final full-suite and OS-matrix results are tracked in INT-1845.
AlexanderZ-Band
left a comment
There was a problem hiding this comment.
my-code-review --fix: final-head review converged with no verified findings. Rechecked the full test/harness diff, including durable background-task ownership after failed explicit closes, reusable lifecycle contexts, declarative approval scenarios, and controlled deadline/callback boundaries. Non-test manifest and lock changes remain unchanged from the reviewed dependency configuration. Regression and order evidence is attached to INT-1845; final OS-matrix results are tracked there.
There was a problem hiding this comment.
my-code-review --fix converged on final head de6fa75 with no verified findings across groups A–F. Test Quality reviewed all changed tests/fixtures and confirmed retained OpenCode turn bodies preserve behavior. Non-test reviewers verified the isolated dependency declarations, lock, released plugin semantics, and CI callers. Edge-case and logical maps found no hypotheses requiring a skeptic. No unresolved feedback, no new simplify changes, and no review fixes required. All 26 selected cases passed individually, fixed/reversed, and under seeds 1845, 791, 32386 and 3446227654. Restoring the grace timed poll reproduces the seed3446227654 hang even with binary precision. Final-head actual Ubuntu/Windows CI passed all six Python3.11–3.13 cells. Full live rollup:41 passed checks,1 conditional skip,0 failures/pending; no unresolved review threads. Seeds, actual orders, negative controls, older native-I/O failures and remaining limitations are documented in INT-1845.
…from-boun-INT-1845 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzhwJvLEnTtZiBUbi7SW6V
Main moved the OpenCode turn task onto TurnState.watcher, and the merge left dev-parlant declaring pytest-randomly twice while the parlant job guard still treated it as parlant-only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzhwJvLEnTtZiBUbi7SW6V
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzhwJvLEnTtZiBUbi7SW6V
AlexanderZ-Band
left a comment
There was a problem hiding this comment.
Blocking — would be REQUEST_CHANGES on a PR by someone else.
my-code-review --fix, cycle 1 on 5764245 (after merging main and a simplify pass). One in-scope issue: TestGraceControls is back on looptime via the merge resolution, and a resync deadline drawn under some pytest-randomly seeds livelocks it (seed 74). One out-of-scope issue: the superseded-connection watchdog test can't fail. Two suggestions and a nit on opencode/test_turns.py. Four hang-vs-fail hypotheses were dropped as no-fix records.
Under looptime a randomized resync deadline can land a fraction of a tick past any reachable virtual time, re-arming the process loop's timeout forever (pytest-randomly seed 74). Restore main's real-time configuration for TestGraceControls while keeping the completion barrier. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzhwJvLEnTtZiBUbi7SW6V
…d clock The human-wait reset test now banks an exact deliberation on the controlled clock and asserts it was banked before the next turn resets it. The turn-timeout test uses the owned make_adapter fixture and crosses turn_timeout_s explicitly, asserting no abort just before the deadline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzhwJvLEnTtZiBUbi7SW6V
AlexanderZ-Band
left a comment
There was a problem hiding this comment.
my-code-review --fix, cycle 2 on 0002765: no verified issues — converged. Two nits and a suggestion on the OpenCode approval-timing tests; four hypotheses (harness task joins, looptime teardown, setup_looptime resets, setup-case match) were dropped as no-fix records.
COMPUTE_BUDGET_S lives once in the OpenCode test helpers; the approval window and timing rows are expressed through it, and a resumed turn that overruns the budget is shown to be aborted with a timeout failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzhwJvLEnTtZiBUbi7SW6V
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzhwJvLEnTtZiBUbi7SW6V
…from-boun-INT-1845 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzhwJvLEnTtZiBUbi7SW6V
…s-from-boun-INT-1845
Why
Selected asyncio tests inferred readiness and deadline behavior from real sleeps and narrow scheduling margins, so results depended on host scheduling and cleanup could be skipped on exceptional exits.
What
Express test intent through a controlled clock, completion barriers, and contexts that own cleanup. OpenCode approval, human-wait and turn-timeout tests advance virtual time across one shared compute budget, including a resumed turn that overruns it. Watchdog tests observe close attempts across deadline, retry and reset boundaries, and retention reporting asserts exact callback order. Adapter owners retain task handles through failed closes, the ACP harness closes partially opened transports, and ACP startup sends run as owned background tasks. The turn-grace test waits on a completion notification instead of a timed poll and stays on real time, since randomized resync deadlines can be unreachable under looptime. pytest-randomly 5.0.0 is pinned in all four isolated development extras.
Scope
Test harnesses and regression coverage; production source is unchanged. The real ACP socketpair boundary, real-I/O safety bounds and exact behavioral assertions stay. The binary precision policy is reused from
tests/toolkit/clock.py. Plan, validation results and open attribution questions: INT-1845. Making the superseded-connection watchdog test able to fail (INT-1875) and splitting OpenCodeTestTurnsby concern (INT-1876) are tracked separately.