Repository navigation
fix: prevent stale database workers across extension tests - #147986
Conversation
Await the existing shared-state close owner before test store resets and temporary-state removal in 37 verified extension fixtures. Expose that existing operation through the private test SDK barrel. Preserve producer completion, synchronous failure-latch resets, and all test assertions. Eighteen selected ordinary cases, all 39 canonical scoped checks, and an independent P2 review of the complete fixture packet pass.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 10:22 AM ET / 14:22 UTC (Revision 5). ClawSweeper reviewWhat this changesExtension tests await shared database worker shutdown before removing temporary state, and the QA attribution fixture uses its own empty docs directory. Merge readiness✅ Ready for maintainer review The cleanup remains useful on current main. No actionable patch defect was found, and the pinned head’s CI completed successfully; this maintainer-protected PR should remain a landing candidate. Priority: P2 Review scores
Verification
How this fits togetherExtension tests exercise OpenClaw’s shared SQLite state through temporary databases. Their teardown must finish producers and retire database workers before deleting fixtures so later tests start with independent state. flowchart TD
A[Extension test fixtures] --> B[Finish producers]
B --> C[Await shared database close]
C --> D[Retire workers and native handles]
D --> E[Reset test state]
E --> F[Delete temporary files]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1, Tests +95. Total +96 across 39 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep fixture shutdown with the existing shared database lifecycle owner, preserving producer settlement, failure-latch resets, and independent temporary directories. Do we have a high-confidence way to reproduce the issue? No deterministic collision reproduction was established in this review. Source confirms that synchronous reset can return before worker retirement; the PR explicitly acknowledges that inode reuse was not separately reproduced. Is this the best way to solve the issue? Yes. Awaiting the existing shutdown owner repairs teardown ordering without introducing another lifecycle implementation, and the QA fixture uses an already-supported isolation option. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 10d67c803047. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Refresh PR #147986 onto main 5c12872 so its independent cleanup prerequisite includes the current UI performance and lint fixes. The merge has no overlap with the 38-file cleanup patch; all prerequisite source bytes and assertions remain unchanged. Preserve the previous 18-case ordinary proof and failed CI result. Recheck the positive voice snapshot and provider-none memory controls against the newer owners.
Merge main 6b3e342, including Docker assertion fix #148129, into PR #147986 while preserving its existing cleanup patch. All 38 prerequisite source files and the complete patch remain identical to the qualified d18 candidate. Preserve its terminal 140-job CI evidence, including the known Docker failure, and the existing local checks and selected ordinary controls. No runtime or package proof is added here.
|
Merged via squash.
|
…147986) * test: drain shared workers before extension fixture cleanup Await the existing shared-state close owner before test store resets and temporary-state removal in 37 verified extension fixtures. Expose that existing operation through the private test SDK barrel. Preserve producer completion, synchronous failure-latch resets, and all test assertions. Eighteen selected ordinary cases, all 39 canonical scoped checks, and an independent P2 review of the complete fixture packet pass. * test(qa): scope attribution renderer to fixture docs
Related: #146557
What Problem This Solves
Fixes extension test cleanup that can leave a database worker alive after its temporary database files are deleted, causing a later fixture to fail with a worker identity collision.
User Impact
There is no user-visible runtime change. Tests retire their shared database workers before deleting temporary state; no schema, persistence, or configuration changes are included.
Why This Change Was Made
The existing synchronous test reset clears cached handles and failure latches, but does not await asynchronous worker retirement. The affected fixtures await the existing shared-state close owner after their producers finish and before resetting test state or deleting files. The private test SDK exposes that existing close operation.
This covers 37 verified lifecycle gaps within the maintained extension-worker test inventory, including the voice-call fixture sequence observed in #146557. Test assertions and existing agent-database cleanup ordering are preserved.
The branch now includes main through
6b3e342ddb1e, including the merged Docker CI assertion fix #148129 and the earlier UI fixes #147973, #147869, and #147749. Both normal main merges had no file overlap with this PR; all 38 cleanup/SDK files and the complete patch remain unchanged fromb085a6e6e546.Evidence
6c7dc49582f7against the newly captured main found no actionable issues.d18b901a30c7. That proof is retained for the identical cleanup patch: the relevant shared-state/worker owners and dependency contracts are unchanged in this refresh.CI run 34828735765 on
d18b901a30c7completed all 140 jobs: 123 succeeded, 15 were skipped, and only the known Docker helper assertion plus the aggregate gate failed. Both previous UI blockers passed. This refresh includes merged fix #148129 for that Docker assertion; new-head CI remains the final verification gate. The earlier failed run 34812209212 is retained as historical evidence.QA attribution fixture follow-up
The marker-attribution fixture now supplies an empty fixture-owned docs root through the renderer’s existing
--docs-rootoption. Its synthetic taxonomy has no docs references, so traversing the repository docs tree was incidental. Both full/slim paths retain the actual producer, importer, scorecard, renderer, assertions, and 60-second deadline.The original CI run 34837317278 completed all 140 jobs and failed only this full-mode attribution test plus the aggregate gate; earlier UI, lint, and Docker blockers passed. The failed job checked out synthetic merge
55e6a45c57b69a4ffd2ae31801c985213bc4aaea(candidate6c7dc49582f7a77ee7d4abfd33b1ef96c536a44aintof4ffd8c21fcd9ff9df417fba01c3c1afb1ad3c7a). The log does not identify the slow phase. This follow-up removes incidental work; it does not claim to have diagnosed that timeout.Focused validation passed exactly the two synthetic marker-attribution full/slim cases (19.7s / 8.8s), with all other cases excluded. All 19 canonical scoped checks passed, including the extension test typecheck, static guards and lint. Fresh independent P2 review is clean. The prior 38-file cleanup qualification remains retained. No installed-package proof is claimed. Current-head CI34844959691 is green: all140 jobs completed,125 passed and15 skipped, including the previously failing QA shard. Native prepare completed successfully at unchanged head
1c920ed3ec1cf8d2d403be61bb37d10d79efda64using hosted evidence; the final maintainer merge remains outstanding.