Skip to content

fix: make heap snapshot OOM test allocate faster#51631

Draft
ckerr wants to merge 1 commit into
mainfrom
fix/oom-spec-flake
Draft

fix: make heap snapshot OOM test allocate faster#51631
ckerr wants to merge 1 commit into
mainfrom
fix/oom-spec-flake

Conversation

@ckerr
Copy link
Copy Markdown
Member

@ckerr ckerr commented May 14, 2026

Description of Change

Fix a timeout CI flake in utilityProcess module behavior supports generating snapshots via v8.setHeapSnapshotNearHeapLimit:

  1. The oom-grow.js fixture triggers OOM to test v8.setHeapSnapshotNearHeapLimit. At ~1KB/tick it needs ~50K iterations to fill 50MB, but V8 (43aa3906777, --late-heap-limit-check) now defers limit checks, so the process never OOMs within the 30s timeout. Fix by allocating 1MB/tick to reach OOM faster.

  2. Change the 'max-old-space-size' from 50 MB to 20 MB to try to exhaust the memory pool faster.

  3. Add '--no-late-heap-limit-check' to try to undo https://chromium-review.googlesource.com/c/v8/v8/+/6919127 which may be contributing to this flake.

Sample CI failure:

Failure in test: "utilityProcess module behavior supports generating snapshots via v8.setHeapSnapshotNearHeapLimit"
Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/runner/work/1/b/src/electron/spec/api-utility-process-spec.ts)
    at createTimeoutError (/Users/runner/work/1/b/src/electron/spec/node_modules/mocha/lib/errors.js:498:15)
    at Test.Runnable._timeoutError (/Users/runner/work/1/b/src/electron/spec/node_modules/mocha/lib/runnable.js:429:10)
Retrying test (1/3)...
Failure in test: "utilityProcess module behavior supports generating snapshots via v8.setHeapSnapshotNearHeapLimit"
Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/runner/work/1/b/src/electron/spec/api-utility-process-spec.ts)
    at createTimeoutError (/Users/runner/work/1/b/src/electron/spec/node_modules/mocha/lib/errors.js:498:15)
    at Test.Runnable._timeoutError (/Users/runner/work/1/b/src/electron/spec/node_modules/mocha/lib/runnable.js:429:10)
Retrying test (2/3)...
Failure in test: "utilityProcess module behavior supports generating snapshots via v8.setHeapSnapshotNearHeapLimit"
Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/runner/work/1/b/src/electron/spec/api-utility-process-spec.ts)
    at createTimeoutError (/Users/runner/work/1/b/src/electron/spec/node_modules/mocha/lib/errors.js:498:15)
    at Test.Runnable._timeoutError (/Users/runner/work/1/b/src/electron/spec/node_modules/mocha/lib/runnable.js:429:10)
Retrying test (3/3)...
not ok 222 utilityProcess module behavior supports generating snapshots via v8.setHeapSnapshotNearHeapLimit
  Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/runner/work/1/b/src/electron/spec/api-utility-process-spec.ts)
  Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/runner/work/1/b/src/electron/spec/api-utility-process-spec.ts)
      at listOnTimeout (node:internal/timers:605:17)
      at processTimers (node:internal/timers:541:7) 
[32290:0511/035302.871179:ERROR:base/process/kill_posix.cc:86] Unable to terminate process 41701: No such process (3)
[32290:0511/035302.871294:ERROR:base/process/kill_posix.cc:32] waitpid(41701): No child processes (10)
[32290:0511/035304.674475:ERROR:base/process/kill_posix.cc:86] Unable to terminate process 41877: No such process (3)
[32290:0511/035304.674540:ERROR:base/process/kill_posix.cc:32] waitpid(41877): No child processes (10)
ok 223 utilityProcess module behavior supports --no-experimental-global-navigator flag
[32290:0511/035305.973469:ERROR:base/process/kill_posix.cc:86] Unable to terminate process 41981: No such process (3)
[32290:0511/035305.973527:ERROR:base/process/kill_posix.cc:32] waitpid(41981): No child processes (10)

Checklist

Release Notes

Notes: none.

@ckerr ckerr added semver/none target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch. labels May 14, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label May 14, 2026
@ckerr ckerr marked this pull request as draft May 15, 2026 01:48
@ckerr ckerr force-pushed the fix/oom-spec-flake branch from b21f61c to 8ec5e7d Compare May 15, 2026 02:54
1. The oom-grow.js fixture triggers OOM to test v8.setHeapSnapshotNearHeapLimit.
At ~1KB/tick it needs ~50K iterations to fill 50MB, but V8 (43aa3906777,
--late-heap-limit-check) now defers limit checks, so the process never OOMs
within the 30s timeout. Fix by allocating 1MB/tick to reach OOM faster.

2. Change the 'max-old-space-size' from 50 MB to 20 MB to try to exhaust
the memory pool faster.

3. Add '--no-late-heap-limit-check' to try to undo
https://chromium-review.googlesource.com/c/v8/v8/+/6919127 which *may*
be making this test flake.

Co-Authored-By: John Kleinschmidt <jkleinsc@github.com>
Co-Authored-By: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com>
Co-Authored-By: GitHub Copilot
@ckerr ckerr force-pushed the fix/oom-spec-flake branch from 8ec5e7d to 44df504 Compare May 15, 2026 21:28
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. target/43-x-y PR should also be added to the "43-x-y" branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant