#55297: test: improve reliability of menu cpp-heap specs
Merged
Description of Change
cpp heap > menu module > should not leak when rebuilding application menu failed once on Windows x64. The C++ heap grew by 75,680 bytes between two identical rounds, against a 10% allowance of 24,232 bytes. That's about the size of one replaced menu, so I checked whether it was a leak or the measurement.
It was the measurement. The spec collected with v8Util.requestGarbageCollectionForTesting(), a synchronous GC that scans the native stack conservatively. A replaced menu, its submenus and its items all reference each other, so a stale pointer to any one of them keeps the whole ~75 KB tree alive, several times the allowance.
Refs #55297 (review)
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
- tests are changed or added
Release Notes
Notes: none
Backports
46-x-y
MergedPR Number
#55358Merged At
Oct 26, 2026, 10:21:47 AM
Released In
v46.0.0-alpha.2Release Date
Oct 26, 2026, 3:00:25 PM
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron