Skip to content

Commit c9da314

Browse files
committed
fix: buffer stdout to handle chunked JSON and prevent test hanging
The listTools response (~25 KB) exceeds the macOS pipe buffer (16 KB), causing it to arrive in multiple chunks. The previous test helper used child.stdout.once('data') which only read the first chunk, resulting in incomplete JSON and parse failures. - Replace once('data') with a buffering reader that accumulates chunks until a complete newline-delimited JSON line is received - Add killChild() helper that destroys stdin/stdout/stderr streams before sending SIGKILL to prevent the test process from hanging - Wrap all test bodies in try/finally to ensure child cleanup on failure - Increase sendRequest timeout from 10s to 30s for slow API responses - Add Node.js version matrix (18, 20, 22) to CI workflow - Update pnpm/action-setup from v3 to v4 - Trigger CI on all push/PR events, not just main branch
1 parent c29e323 commit c9da314

2 files changed

Lines changed: 330 additions & 271 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
name: CI
22
on:
3-
push:
4-
branches:
5-
- main
6-
pull_request:
7-
branches:
8-
- main
3+
- push
4+
- pull_request
95
jobs:
10-
test:
11-
runs-on: ubuntu-latest
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os:
11+
- ubuntu-latest
12+
node_version:
13+
- 18
14+
- 20
15+
- 22
16+
name: Node ${{ matrix.node_version }} on ${{ matrix.os }}
1217
steps:
1318
- uses: actions/checkout@v4
14-
- uses: pnpm/action-setup@v3
19+
- uses: pnpm/action-setup@v4
1520
with:
1621
version: 9
17-
- uses: actions/setup-node@v4
22+
- name: Setup node
23+
uses: actions/setup-node@v4
1824
with:
19-
node-version: 18
25+
node-version: ${{ matrix.node_version }}
2026
cache: 'pnpm'
21-
- run: pnpm install
22-
- run: pnpm test
27+
- name: Install dependencies
28+
run: pnpm install
29+
- name: Run tests
30+
run: pnpm test

0 commit comments

Comments
 (0)