test(cli): allow mac startup memory overhead · openclaw/openclaw@978cb6a
steipete
·
2026-05-27
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -62,11 +62,18 @@ function parseArgs(argv) {
|
62 | 62 | return options; |
63 | 63 | } |
64 | 64 | |
65 | | -const DEFAULT_LIMITS_MB = { |
66 | | -help: 100, |
67 | | -statusJson: 400, |
68 | | -gatewayStatus: 500, |
69 | | -}; |
| 65 | +function resolveDefaultLimitsMb(platform = process.platform) { |
| 66 | +return { |
| 67 | +// Linux CI is the tight startup regression signal. macOS consistently reports |
| 68 | +// higher RSS for the same launcher path, so keep it supported without hiding |
| 69 | +// Linux help-path regressions. |
| 70 | +help: platform === "darwin" ? 300 : 100, |
| 71 | +statusJson: 400, |
| 72 | +gatewayStatus: 500, |
| 73 | +}; |
| 74 | +} |
| 75 | + |
| 76 | +const DEFAULT_LIMITS_MB = resolveDefaultLimitsMb(); |
70 | 77 | |
71 | 78 | const cases = [ |
72 | 79 | { |
@@ -334,6 +341,7 @@ function runStartupMemoryCheck(argv = process.argv.slice(2), params = {}) {
|
334 | 341 | export const testing = { |
335 | 342 | cases, |
336 | 343 | parseArgs, |
| 344 | + resolveDefaultLimitsMb, |
337 | 345 | runCase, |
338 | 346 | runStartupMemoryCheck, |
339 | 347 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -20,6 +20,11 @@ afterEach(() => {
|
20 | 20 | }); |
21 | 21 | |
22 | 22 | describe("check-cli-startup-memory", () => { |
| 23 | +it("keeps the Linux help startup budget tight while allowing macOS RSS overhead", () => { |
| 24 | +expect(testing.resolveDefaultLimitsMb("linux").help).toBe(100); |
| 25 | +expect(testing.resolveDefaultLimitsMb("darwin").help).toBeGreaterThan(100); |
| 26 | +}); |
| 27 | + |
23 | 28 | it("does not create a temp home before argument validation succeeds", () => { |
24 | 29 | if (process.platform !== "darwin" && process.platform !== "linux") { |
25 | 30 | return; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。