Files
wekan/tests/testBuildMemory.test.cjs
T
Lauri Ojansivu e39e4a1200 The Meteor test build runs again: it no longer compiles the 190 MB legacy client bundle.
meteor test --full-app died before any test started with "FATAL ERROR:
Zone Allocation failed - process out of memory" once the help texts grew
every locale file. A larger tool heap did not help: in test mode the
whole client bundle was compiled again for legacy browsers as one file of
170 to 190 MB (it grew with each locale), and V8's compiler gave up on
it. No test uses the legacy browser build, so every meteor test run in
build.sh and package.json now passes --exclude-archs
web.browser.legacy,web.cordova. And Meteor 3.6's watcher subscribes to
the whole app directory without reading .meteorignore, so it walked all
of .tools/ and used up the inotify watches; the --once runs set
METEOR_WATCH_FORCE_POLLING=true.

With both, the server tests run to the end: 693 passing, 6 failing - the
first run in a long time, so those six are findings to look at.
tests/testBuildMemory.test.cjs keeps every run with both settings.

Thanks to xet7 !
2026-11-24 16:52:37 +02:00

31 lines
1.3 KiB
JavaScript

'use strict';
// The Meteor test build ran out of memory before any test started (FATAL
// ERROR: Zone Allocation failed) once the help texts grew every locale file:
// in test mode the whole client bundle - one file of 170 to 190 MB - was
// compiled again for legacy browsers, and V8's compiler gave up on it. No
// test uses the legacy browser build, so every `meteor test` run skips it.
// Meteor 3.6's watcher also walked all of .tools/ (it does not read
// .meteorignore), so the --once runs turn it off.
// Run: node --test tests/testBuildMemory.test.cjs
const { test } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const ROOT = path.join(__dirname, '..');
const read = rel => fs.readFileSync(path.join(ROOT, rel), 'utf8');
test('every meteor test run skips the legacy browser build and the watcher', () => {
const runs = [
...read('build.sh').split('\n').filter(l => /\bmeteor test --full-app/.test(l) && !/^\s*(#|echo)/.test(l)),
JSON.parse(read('package.json')).scripts.test,
];
assert.ok(runs.length >= 3, `found ${runs.length}`);
for (const run of runs) {
assert.match(run, /--exclude-archs web\.browser\.legacy,web\.cordova/, run);
assert.match(run, /METEOR_WATCH_FORCE_POLLING=true/, run);
}
});