Skip to content

fix(test): bump runCli maxBuffer to fit growing manifest#1842

Open
Benjamin-eecs wants to merge 2 commits into
jackwener:mainfrom
Benjamin-eecs:fix/e2e-runcli-maxbuffer
Open

fix(test): bump runCli maxBuffer to fit growing manifest#1842
Benjamin-eecs wants to merge 2 commits into
jackwener:mainfrom
Benjamin-eecs:fix/e2e-runcli-maxbuffer

Conversation

@Benjamin-eecs
Copy link
Copy Markdown
Contributor

Description

tests/e2e/helpers.ts uses promisify(execFile) without passing maxBuffer, so it inherits Node's 1 MB default. On v1.8.2 node dist/src/main.js list -f json | wc -c measures 1,067,516 bytes, which is just past the default. execFile rejects with code: 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER', the catch block returns that string as the result code, and the E2E assertions expect(code).toBe(0) fail with the literal 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER'. The failure repros on both ubuntu and macos in the E2E Headed Chrome workflow on ec3eddec chore(release): 1.8.2 (#1830), and affects tests/e2e/management.test.ts > list shows all registered commands plus tests/e2e/output-formats.test.ts > list -f json produces valid output. yaml / csv / md formats stayed under 1 MB so they passed, but the underlying helper has no headroom for any future adapter additions in any format.

Pass an explicit maxBuffer of 16 MB to execFile, with an optional opts.maxBuffer override for callers that need a different bound. 16 MB gives roughly 15x headroom over the current manifest size and matches the order-of-magnitude that other Node CLIs default to when wrapping their own subprocesses. The default behavior of every existing runCli caller is preserved; only the silent overflow ceiling moves.

Related issue: closes #1841.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🌐 New site adapter
  • 📝 Documentation
  • ♻️ Refactor
  • 🔧 CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful

Screenshots / Output

Pre-fix repro on upstream/main v1.8.2:

$ node dist/src/main.js list -f json | wc -c
 1067516

$ npx vitest run tests/e2e/management.test.ts -t "list shows all registered commands"
× tests/e2e/management.test.ts > list shows all registered commands
   AssertionError: expected 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER' to be +0

Post-fix on this branch:

$ npx vitest run tests/e2e/management.test.ts tests/e2e/output-formats.test.ts
 Test Files  2 passed (2)
      Tests  16 passed (16)

Full local check: npx tsc --noEmit clean. tests/e2e/management.test.ts + tests/e2e/output-formats.test.ts 16/16. cli-manifest.json untouched.

opencli list -f json crossed 1 MB at 1030 entries on v1.8.2 so the execFile default overflows and the helper returns code ERR_CHILD_PROCESS_STDIO_MAXBUFFER instead of the real exit code.

Closes jackwener#1841
@Benjamin-eecs Benjamin-eecs marked this pull request as ready for review June 3, 2026 09:15
Copilot AI review requested due to automatic review settings June 3, 2026 09:15
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates the E2E CLI helper to handle large stdout payloads from opencli commands by increasing the child process maxBuffer and making it configurable.

Changes:

  • Extend runCli options to accept maxBuffer.
  • Set a higher default maxBuffer (16 MiB) to prevent ERR_CHILD_PROCESS_STDIO_MAXBUFFER.
  • Pass maxBuffer through to the underlying exec call.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/e2e/helpers.ts Outdated
Comment on lines +31 to +34
// `opencli list -f json` already weighs ~1 MB at 1030 entries on v1.8.2 and
// grows with every new adapter. The execFile default maxBuffer is 1 MB; past
// it stdout overflows and the helper returns code
// 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER' instead of the actual exit code.
Comment thread tests/e2e/helpers.ts
export async function runCli(
args: string[],
opts: { timeout?: number; env?: Record<string, string> } = {},
opts: { timeout?: number; env?: Record<string, string>; maxBuffer?: number } = {},
Comment thread tests/e2e/helpers.ts Outdated
// grows with every new adapter. The execFile default maxBuffer is 1 MB; past
// it stdout overflows and the helper returns code
// 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER' instead of the actual exit code.
const maxBuffer = opts.maxBuffer ?? 16 * 1024 * 1024;
Pulls the runCli stdout cap out of the function body so future tuning lands in one place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: E2E runCli helper hits ERR_CHILD_PROCESS_STDIO_MAXBUFFER on opencli list -f json

2 participants