test(cli): allow mac startup memory overhead

This commit is contained in:
Peter Steinberger
2026-05-26 21:15:48 -04:00
parent d5b5eaccc2
commit 978cb6ac20
2 changed files with 18 additions and 5 deletions
+13 -5
View File
@@ -62,11 +62,18 @@ function parseArgs(argv) {
return options;
}
const DEFAULT_LIMITS_MB = {
help: 100,
statusJson: 400,
gatewayStatus: 500,
};
function resolveDefaultLimitsMb(platform = process.platform) {
return {
// Linux CI is the tight startup regression signal. macOS consistently reports
// higher RSS for the same launcher path, so keep it supported without hiding
// Linux help-path regressions.
help: platform === "darwin" ? 300 : 100,
statusJson: 400,
gatewayStatus: 500,
};
}
const DEFAULT_LIMITS_MB = resolveDefaultLimitsMb();
const cases = [
{
@@ -334,6 +341,7 @@ function runStartupMemoryCheck(argv = process.argv.slice(2), params = {}) {
export const testing = {
cases,
parseArgs,
resolveDefaultLimitsMb,
runCase,
runStartupMemoryCheck,
};
@@ -20,6 +20,11 @@ afterEach(() => {
});
describe("check-cli-startup-memory", () => {
it("keeps the Linux help startup budget tight while allowing macOS RSS overhead", () => {
expect(testing.resolveDefaultLimitsMb("linux").help).toBe(100);
expect(testing.resolveDefaultLimitsMb("darwin").help).toBeGreaterThan(100);
});
it("does not create a temp home before argument validation succeeds", () => {
if (process.platform !== "darwin" && process.platform !== "linux") {
return;