Repository navigation
fix(ci): drain heartbeat fixture state before deleting its files - #153591
Conversation
|
🦞👀 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 20, 2026, 5:34 AM ET / 09:34 UTC (Revision 2). ClawSweeper reviewWhat this changesThe heartbeat tests now await shared-state database shutdown before resetting fixture state and deleting temporary files. Merge readiness✅ Ready for maintainer review The repair remains necessary on current main, and no actionable patch defects were found. The updated Linux evidence and verified file isolation resolve the previous review’s replay concern. Priority: P3 Review scores
Verification
How this fits togetherHeartbeat outcome tests exercise SQLite persistence and worker-backed claims using temporary databases. Their cleanup must retire workers, handles, and cached file identities before subsequent tests create new databases. flowchart TD
A[Heartbeat test cases] --> B[Temporary SQLite databases]
B --> C[Drain agent workers]
C --> D[Await shared-state shutdown]
D --> E[Reset test state]
E --> F[Delete temporary files]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +4. Total +4 across 1 file. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep fixture deletion behind the existing lifecycle owner’s completed shutdown, preserving all production guards and test assertions. Do we have a high-confidence way to reproduce the issue? Yes, the source establishes that synchronous cleanup retains identity records across file deletion, providing a concrete failure mechanism when physical identities are reused. This read-only review did not execute a current-main reproduction. Is this the best way to solve the issue? Yes. Calling the existing asynchronous close before reset and deletion matches the established sibling fixture and fixes cleanup without weakening checks or adding another lifecycle owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 03e1d2043091. LabelsLabel 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)
|
|
The Linux evidence is now available in the exact-head changed-test job. I retrieved its completed logs: checkout was The job ran Test-only CI selects this exact file rather than the whole outer heartbeat-core group. That does preserve the relevant state sequence: the infra configuration uses |
|
Merged via squash.
|
Include the merged heartbeat fixture drain repair from #153591. The workspace cleanup production diff remains unchanged. Verified 98 workspace tests with one existing platform skip and all 31 selected checks. Reuse the unchanged independent P2 review inputs.
What Problem This Solves
Fixes false heartbeat worker-identity failures in Linux CI after earlier test cases delete their temporary state directories.
User Impact
No production behavior changes. The heartbeat tests retain their current assertions, deadlines, and native worker authority checks.
Why This Change Was Made
The outcome-store fixture drains agent workers, but only synchronously closes shared-state handles before deleting its directories. Shared-state async lifecycle records therefore survive deletion. When a later file has the same physical identity, the captured record can still name the previous canonical path and the native lease guard correctly refuses it.
Await shared-state shutdown before the synchronous test reset and directory removal, matching the existing heartbeat sandbox cleanup. This drains resources and retires their identity records through the existing owner. No schema, lifecycle implementation, or admission-guard changes.
Evidence
core-runtime-infra-heartbeat-coreatAgent worker lease differs from its captured native owner.15affb5bc00ea79c4717d07e24f066430e05d5b9, incorporating refactor(heartbeat): run outcome queries in the agent database worker #147463 from main into unrelated updater PR fix(update): verify paired trusted-proxy gateways with service credentials #153540. The updater source head predates the heartbeat worker cutover. This repair is based on main6584af0ae9aee96cda722b2254d06b716a6edec4.ae3a4391cdba21697ee3268e38ee9575eab6609a. Test-only routing ran the exact file through the unchanged isolated infra configuration; the entire outer heartbeat-core group was not rerun.