mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
test(cli): allow mac startup memory overhead
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user