Skip to content

fix(doctor): close test state before Windows fixture cleanup - #150676

Merged
steipete merged 1 commit into
mainfrom
codex/doctor-fixture-coordinator
Sep 17, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/doctor-fixture-coordinator

Conversation

@steipete

@steipete steipete commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Windows Doctor plugin-install tests failing during temporary-directory cleanup because cached SQLite handles and coordinator files outlive the per-case homes.

User Impact

No product behavior changes. The existing Windows test suite cleans up its state reliably without retries or relaxed assertions.

Why This Change Was Made

Use the existing coordinator runtime-directory owner for the suite lifetime, and drain cached state workers and database handles before removing each case's tracked directories. The existing fixture helper owns this setup together with the hermetic test home.

Evidence

  • Reproduced the original EPERM through the unchanged suite on Windows.
  • All 140 original cases pass with the final fixture repair. Assertions, timeouts, and retry settings are unchanged.
  • Full changed-code checks pass, including test type graphs, lint, formatting, unused-export scans, and owner guards.
  • Independent review through P2 is clean; source and build-input hashes remained unchanged throughout validation.
  • Exact-head CI passes.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S maintainer Maintainer-authored PR labels Sep 17, 2026
@steipete
steipete marked this pull request as ready for review September 17, 2026 06:21
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 2:46 AM ET / 06:46 UTC (Revision 2).

ClawSweeper review

What this changes

The PR closes cached test databases before deleting temporary directories and keeps coordinator files in a suite-owned directory to prevent Windows cleanup failures.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fixture repair absent from current main. No actionable defect was found, and the protected maintainer PR should remain open for normal landing.

Priority: P3
Reviewed head: a3926399cd6bc571992883a419fd6d0444258ce7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused lifecycle repair using existing owners, with unchanged assertions and successful pinned-head CI.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a maintainer-authored fixture repair, so the external-contributor proof gate does not apply; reported Windows suite results exercise the changed teardown path, and pinned-head CI success was verified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a maintainer-authored fixture repair, so the external-contributor proof gate does not apply; reported Windows suite results exercise the changed teardown path, and pinned-head CI success was verified.
Evidence reviewed 7 items Fixture lifecycle repair: The helper awaits the existing asynchronous database close owner before directory cleanup and scopes coordinator files to the suite home. The introduced diff leaves test assertions, retries, and timeouts unchanged.
Existing shutdown and coordinator contracts: closeOpenClawStateDatabaseAsync drains asynchronous resources before retiring native handles. The coordinator runtime-directory owner captures an asynchronous scope with keepAlive disabled for a supplied directory string.
Current main still needs the repair: Comparison with fetched main retains exactly the fixture repair: main still removes per-case directories without the added asynchronous close and suite coordinator scope.
Findings None None.
Security None None.

How this fits together

Doctor’s plugin-install tests exercise repair behavior using temporary homes and SQLite state. Their fixture lifecycle must release database workers and handles before removing those homes.

flowchart TD
 A[Plugin repair test cases] --> B[Temporary homes and SQLite state]
 C[Suite-owned coordinator directory] --> B
 B --> D[Await database worker and handle shutdown]
 D --> E[Remove per-case directories]
 E --> F[Clean up suite home]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +25. Total +25 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 39 14 +25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 39 14 +25

Review metrics

None.

Technical review

Best possible solution:

Keep fixture teardown with its existing lifecycle owners so database resources settle before temporary homes are removed.

Do we have a high-confidence way to reproduce the issue?

Yes, the existing Windows suite provides a concrete reproduction path: per-case homes can be removed while cached SQLite resources remain open. The PR reports baseline EPERM reproduction; this review verified the source mechanism without executing tests.

Is this the best way to solve the issue?

Yes. Reusing the asynchronous shutdown and coordinator-directory owners fixes fixture lifetime ordering without weakening coverage or altering production behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8b9739cc48c0.

Labels

Label justifications:

  • P3: This repairs internal Windows test cleanup without changing product behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a maintainer-authored fixture repair, so the external-contributor proof gate does not apply; reported Windows suite results exercise the changed teardown path, and pinned-head CI success was verified.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-17T06:27:57.723Z sha a392639 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 14ff4df into main Sep 17, 2026
176 checks passed
@steipete
steipete deleted the codex/doctor-fixture-coordinator branch September 17, 2026 06:47
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant