Skip to content

fix(ci): stop using the vmForks pool in CI — it OOMs before the suite reports - #126

Open
cryptolir wants to merge 1 commit into
mainfrom
investigate/ci-test-hang
Open

cryptolir wants to merge 1 commit into
mainfrom
investigate/ci-test-hang

Conversation

@cryptolir

Copy link
Copy Markdown
Owner

CI's node test job dies without reporting

50 minutes, no failing step, no summary. It looks like a hang; it isn't. The vmForks pool retains memory across test files, so unit-fast workers climb to the heap ceiling and V8 aborts:

FATAL ERROR: Ineffective mark-compacts near heap limit
Allocation failed - JavaScript heap out of memory
Mark-Compact 5964.9 (6178.2) -> 5952.8 (6181.4) MB

Measured, not inferred

On DevAgents with CI's own settings — CI=true, OPENCLAW_TEST_WORKERS=2, 6144 MB heap, Node 22.22.3 (CI pins 22.x, so the pool decision is identical). Only the pool differed:

result
vmForks on two workers reach ~5.96 GB, dead at ~130 s; unit-fast never reports
vmForks off suite completes in 293 s, no OOM, 6614/6615 unit tests pass

The host had 13–22 GB free throughout, so this is the per-process V8 limit, not the machine.

Then verified again after this change with no OPENCLAW_TEST_VM_FORKS override, so the code path is what fixes it rather than the escape hatch: 0 OOM, exit 0.

Why not just raise the heap again

Because that is what happened last time. The 6144 MB limit exists for this exact failure — ci.yml still says "Default heap limits have been too low on Linux CI (V8 OOM near 4GB)". Raising the ceiling deferred the failure; the growth has since outrun the new ceiling too. A third bump buys a few more weeks.

The change

One condition: skip vmForks when isCI. This is the same treatment the file already gives Windows and Node 24 — the pool is disabled where it misbehaves. Local runs are untouched, and both escape hatches still work: =0 opts out anywhere, =1 forces it back on in CI to re-measure once the leak is fixed.

⚠️ What this does NOT do

It does not fix the leak — it stops the leak being fatal. The leak is why the heap was raised once already, and it will keep growing. Worth a tracked follow-up; I did not chase it here because it is open-ended and CI has been unable to complete a run for weeks.

That matters more than it sounds: a suite that never finishes reports nothing. That is how the persona breakage in #125 sat on main unnoticed.

Note on the remaining red

Two failures in my local runs are not regressions and are untouched:

  • src/plugins/discovery.test.ts "blocks suspicious ownership…" — fails only as root, because the check trusts root-owned files by design (discovery.ts:127-128). Passes on CI's non-root runner.
  • 15 extensions/* files missing optional deps (matrix-bot-sdk, google-auth-library) — an artifact of my symlinked node_modules, not of CI.

Review asks

  1. Is disabling the pool in CI the right trade? It costs the transform-heavy fast path exactly where wall-clock matters most. The alternative is chasing the leak first and leaving CI broken meanwhile.
  2. Should local runs lose vmForks too? The leak presumably exists there as well; local runs simply have no heap cap, so nobody has hit the wall yet.
  3. Any reason unit-fast in particular would retain memory under VM contexts — a known global, or a shared module-level cache?

@codex review

… reports

CI's node test job has been dying without reporting: 50 minutes, no failing
step, no summary. It is not a hang. The vmForks pool retains memory across test
files, so unit-fast workers climb to the heap ceiling and V8 aborts with
"Ineffective mark-compacts near heap limit".

Measured on DevAgents with CI's own settings (CI=true, OPENCLAW_TEST_WORKERS=2,
6144 MB heap, Node 22.22.3 — CI pins 22.x, so the pool decision is identical).
Only the pool differed between runs:

  vmForks on  -> two workers reach ~5.96 GB and die at ~130 s; unit-fast never
                 reports. Host had 13-22 GB free throughout, so this is the
                 per-process V8 limit, not the machine.
  vmForks off -> suite completes in 293 s, no OOM, 6614/6615 unit tests pass.

Verified again after this change with NO OPENCLAW_TEST_VM_FORKS override, so the
code path is what fixes it rather than the escape hatch: 0 OOM, exit 0.

The heap was already raised to 6144 MB for this ("V8 OOM near 4GB" in ci.yml).
That deferred the failure instead of fixing it and the growth has since outrun
the higher ceiling, so raising it again is not the answer. This applies the same
treatment the file already gives Windows and Node 24 — skip the pool where it
misbehaves — and leaves local runs untouched. Both escape hatches still work:
=0 opts out anywhere, =1 forces it back on in CI to re-measure.

The leak itself is not fixed here, only made non-fatal. Worth chasing separately:
it is why the heap was raised once already, and it will keep growing.

Co-Authored-By: Claude Opus 5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 6ed6be0899

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant