Repository navigation
fix(test): retain OOM fixture buffers across garbage collection - #160276
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 28, 2026, 4:20 AM ET / 08:20 UTC. ClawSweeper reviewWhat this changesThe branch keeps buffers in two disposable OOM-test child processes reachable until the Linux memory-scope test completes. Merge readiness✅ Ready for maintainer review Current main still has the unrooted OOM test workload. The merged related repair covers a different retention fixture, so this focused PR remains useful. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw CI runs this integration test through a managed process launcher that places child workloads in a Linux systemd memory scope. The test checks for an OOM exit and verifies that the scope is removed. flowchart LR
A[CI test run] --> B[OOM fixture]
B --> C[Managed process launcher]
C --> D[Linux memory scope]
D --> E[Child buffer workloads]
E --> F[Exit and cleanup checks]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +1. Total +1 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the real cgroup OOM test deterministic with reachable buffers while preserving its exit-code and scope-removal assertions. Do we have a high-confidence way to reproduce the issue? Yes. The PR reports an original-shard Bun timeout and a paired garbage-collection probe, while current main retains the same unrooted fixture; this review did not execute the test. Is this the best way to solve the issue? Yes. Rooting the disposable children's buffers addresses the reported lifetime failure without weakening the existing OOM or cleanup checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5362ba0ca317. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…claw#160276) Keep the synthetic child buffer arrays reachable until the kernel ends the workload. The previous empty interval retained the processes but allowed Bun to collect their buffers before aggregate usage crossed the cgroup limit. Preserve allocation count and size, the 256 MiB limit, deadlines, exit-137 assertion, scope cleanup and runtime routing. The paired Bun probe retains 0 versus 16 buffers; 20 complete file runs and three original-shard replays pass, and a nonbinding-limit control still fails. Final-head Blacksmith focused proof, changed checks, independent review, ClawSweeper review and hosted CI pass. The separate plugin-retention repair was already landed in openclaw#160200 and is not duplicated here.
What Problem This Solves
The cgroup OOM integration test can time out under Bun because garbage collection releases its supposedly live buffer workload before aggregate memory crosses the limit.
User Impact
No product behavior changes. The existing CI regression now keeps its intended memory workload alive until the kernel terminates it.
Why This Change Was Made
Root the existing allocation array on
globalThisin each disposable child process. Allocation count and size, the 256 MiB limit, deadlines, exit-137 assertion and scope-removal assertion are unchanged. The empty interval callback kept the original process alive without keeping its buffers reachable.Found while repairing inherited CI after #160032. The separate plugin-retention repair landed concurrently in #160200; its identical implementation is used from main rather than duplicated here. This PR changes only the OOM fixture.
Evidence
Blacksmith Testbox
tbx_01m3kaa3vxetwymptnwwzfq894, using checksum-pinned CI Bun1.4.3-canary.1+6b9148b17:core-unit-fast-2selection failed this test withManaged command timed out after 15000mswhile all plugin-retention cases passed.-eprobe using the same 16 × 8 MiB allocation showed 0 live buffers after native GC with the original local array, versus 16 with the explicit root.OPENCLAW_VITEST_RUNTIME=bun pnpm test test/scripts/managed-memory.integration.test.ts --maxWorkers=1. Mean wall 12.62 s; range 12.32–14.15 s, including runner preparation. The unchanged file also covers real signal propagation, cancellation grace and process-tree cleanup.That campaign ran on the channel-merge base with the now-upstream-equivalent retention repair. Before publication, this branch was rebased onto fresh main and the duplicate retention patch was dropped. The OOM fixture and its managed-process/memory owners are unchanged across that rebase. Its old changed-check run stopped on the inherited duplicate
dataImageClipboardFileexport, already repaired on main bybb05e779e2a; no passing gate is claimed from that failed attempt.Final head
c933e2efd9e360d80df7b9759189843e9a341254, source tree67a0d45a9b1e96a4a96d3218246ac8048e7a19df, was verified on fresh Blacksmith Testboxtbx_01m3kgwgy2gtnm49pkwjh47dz7. The focused Bun file passed 8/8, andnode scripts/check-changed.mjspassed all selected guards, four test-root typecheck shards, dead-export scans and lint with zero warnings/errors. The complete install/proof command took 626.20 s.Exact-head CI run 36396220676 passed, including the CI gate. The selected Node test job took 202 s including setup; the real OOM fixture execution and timings above are Testbox evidence. Exact-head ClawSweeper review has no findings or remaining before-merge items.
Both repair Testboxes are stopped. Temporary negative-control mutations were restored before the passing shard/sibling checks; all final proof used the committed fixture bytes.