Skip to content

test(gateway): reduce server shard memory pressure#73317

Merged
vincentkoc merged 1 commit intomainfrom
investigate/gateway-sessions-shard-hotspot
Apr 28, 2026
Merged

test(gateway): reduce server shard memory pressure#73317
vincentkoc merged 1 commit intomainfrom
investigate/gateway-sessions-shard-hotspot

Conversation

@vincentkoc
Copy link
Copy Markdown
Member

Summary

  • Run the gateway-server Vitest project in the fork pool to reduce retained worker/module-graph memory.
  • Keeps the full gateway suite below the previous RSS peak without the 3x slowdown from isolate: true.

Evidence

  • Baseline after test(gateway): keep session event suite minimal #73302: pnpm test:gateway passed 257 files / 3003 tests, elapsed 57.92s, max RSS 4,429,864 KB.
  • With this patch: pnpm test:gateway passed 257 files / 3003 tests, elapsed 56.78s, max RSS 3,711,392 KB.
  • OPENCLAW_TESTBOX=1 pnpm check:changed passed.
  • pnpm exec oxfmt --check --threads=1 test/vitest/vitest.gateway-server.config.ts passed after rebase.
  • git diff --check origin/main...HEAD passed after rebase.

Notes

  • No changelog: test configuration only.
  • AI-assisted: yes; I understand the one-line Vitest config change and verified the touched surface above.

@vincentkoc vincentkoc self-assigned this Apr 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Apr 28, 2026
@vincentkoc vincentkoc marked this pull request as ready for review April 28, 2026 05:57
@vincentkoc vincentkoc merged commit 5828dcd into main Apr 28, 2026
89 of 91 checks passed
@vincentkoc vincentkoc deleted the investigate/gateway-sessions-shard-hotspot branch April 28, 2026 05:58
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 28, 2026

Greptile Summary

This PR adds pool: "forks" to the gateway-server Vitest project config, switching from the default threads pool to a forks (child-process) pool. The createScopedVitestConfig helper already accepts and correctly propagates this option, so the change is a single-line, well-supported addition that measurably reduces peak RSS (~15%) with no regression in test count or elapsed time.

Confidence Score: 5/5

Safe to merge — purely a test-configuration change with no production code impact.

Single-line change to a Vitest config option that is already typed and handled in the shared config helper. No logic changes, no production code touched, and the PR provides benchmark evidence of the improvement.

No files require special attention.

Reviews (1): Last reviewed commit: "test(gateway): reduce server shard memor..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant