Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(self-hosted-lanes): cover frontend node heap options per profile

Steven Enamakel6811935677a1
diff --git a/scripts/__tests__/self-hosted-lanes.test.mjs b/scripts/__tests__/self-hosted-lanes.test.mjs
index 352a0105dd..d171de2c7a 100644
--- a/scripts/__tests__/self-hosted-lanes.test.mjs
+++ b/scripts/__tests__/self-hosted-lanes.test.mjs
@@ -841,3 +841,20 @@ test("process-static scan uses cancellation supervision in both profiles", () =>
);
}
});
+
+test("private frontend tools have an explicit 4 GiB Node heap while hosted keeps its default", () => {
+ for (const plan of plans()) {
+ const frontend = plan.lanes.find((lane) => lane.name === "frontend");
+ if (plan.profile === "ex63") {
+ assert.equal(frontend.env.NODE_OPTIONS, "--max-old-space-size=4096");
+ const probe = spawnSync(process.execPath, ["-e", "console.log(require('node:v8').getHeapStatistics().heap_size_limit)"], {
+ env: { ...process.env, NODE_OPTIONS: frontend.env.NODE_OPTIONS }, encoding: "utf8",
+ });
+ assert.equal(probe.status, 0, probe.stderr);
+ const limit = Number(probe.stdout.trim());
+ assert.ok(limit >= 4096 * 1024 * 1024 && limit < 4352 * 1024 * 1024, `actual V8 heap limit ${limit}`);
+ } else {
+ assert.equal(frontend.env.NODE_OPTIONS, undefined);
+ }
+ }
+});