Repository navigation
test(matrix): join account-state Doctor fixture cleanup - #155679
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 7:09 AM ET / 11:09 UTC (Revision 2). ClawSweeper reviewWhat this changesThe Matrix Doctor migration test now waits for its full body and asynchronous database cleanup before deleting temporary files, preserves combined failures, and reuses shared test-lifetime helpers. Merge readiness✅ Ready for maintainer review This remains a useful, focused fixture-lifecycle repair that current main does not contain. No introduced correctness or security defect was found; the maintainer-authored PR should proceed through normal review and CI. Priority: P3 Review scores
Verification
How this fits togetherThe Matrix migration test loads an older account database, runs OpenClaw Doctor, and checks database preservation and subsequent writes. Its fixture lifetime controls when temporary inputs can safely be removed. flowchart TD
A[Older account database fixture] --> B[Fixture lifetime]
B --> C[Doctor child process]
C --> D[Migration and reopen assertions]
D --> E[Await database cleanup]
E --> F{Cleanup verified}
F -->|Yes| G[Remove temporary files]
F -->|No| H[Retain files and report failures]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +4, Tests +34. Total +38 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep temporary inputs owned until the complete test and database shutdown settle, while retaining original diagnostics when cleanup cannot be verified. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the fixture-lifetime gap: current main can delete temporary inputs during teardown without joining the entire asynchronous body. This review did not execute the failure or reproduce the historical 120-second timeout. Is this the best way to solve the issue? Yes, reusing the existing lifetime owner and canonical asynchronous Matrix reset is a narrow repair that preserves the migration checks and child deadline. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 370b6ea2aae3. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
The Matrix account-state Doctor test deletes its temporary state in
afterEach, before the CLI helper'sonTestFinishedhook joins its child. A failed or timed-out case can therefore remove inputs while admitted work still uses them. Synchronous database resets also do not join the cached async database owner.User Impact
Makes this test own its complete fixture lifetime and preserve failure diagnostics. Matrix behavior, stored data, schemas, configuration, and the Doctor child's 120-second deadline are unchanged.
Why This Change Was Made
Use the existing fixture lifetime for the complete async case, including post-CLI database assertions. Await the canonical async Matrix store reset before Doctor, before reopening, and at final cleanup; remove the root only after the body and verified cleanup settle. Preserve both the original failure and cleanup failure when they occur together.
Expose the existing lifetime and enclosing-timeout helpers through the private test-env seam. The canonical outer envelope is 132 seconds, reserving setup/diagnostic/cleanup time around the unchanged 120-second child budget.
Executable production: +0/-0. Tests and private test support: +124/-86 across two files.
Evidence
Current candidate
acce3e8787432d5a1210a9b97abe9de5efab1bcduses sequential cleanup after capturing the body outcome, preserving both original errors and the caught cleanup error as the aggregate cause. Formatting, focused repository-config lint and independent P0–P2 source review pass. Final-candidate native qualification passed all 102 cases: three lifetime/error controls followed by the original 11-file/two-worker Matrix group (99 cases), with no skips, failures, or retries. The account-state case took 51.867 seconds; the original group took 100.99 seconds in Vitest and 104.398 seconds under its managed runner. The control group took 63.94 seconds in Vitest and 67.486 seconds under its managed runner. All managed work joined, all 48,293 source paths were restored and verified, and the owned lease stopped with fresh completed status. This final-candidate run used Linux x64/Node 24.19.0, four CPUs and 16.56 GB. The original input list and worker count were preserved; actual scheduler order and preceding controls remain distinct from the historical failure. The completed exact-head ClawSweeper review reports no findings or remaining moves. Current-head CI, attempt 1, completed successfully: 119 jobs passed, 18 were skipped, and none failed. The aggregate gate passed; actual preflight mergefaa6cf0d22ec67e49f6dcc84ff113489a881af6bcontains this exact head and both reviewed blobs. No hosted case-level Matrix mapping is inferred from compact shard names.At the preceding head
bb6a17a4b14648d1a2d74dbdaa194bfeb77c9460, native qualification verified:The proof used Linux x64/Node 24.19.0, four CPUs and 16.56 GB, versus the failing job's two CPUs/8.22 GB. Original group inputs and worker count were preserved; observed scheduler order differed and the group followed the control runs. No-output retries were disabled for this proof; case and child deadlines were preserved.
This proves the fixture ownership defect and repair. It does not identify the slow phase behind the historical 120-second failure or claim a performance fix. The old-fixture counterexample and seven shared regressions above remain attributed to the preceding head.