Commit c9da314
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 branch1 parent c29e323 commit c9da314
2 files changed
Lines changed: 330 additions & 271 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 3 | + | |
| 4 | + | |
9 | 5 | | |
10 | | - | |
11 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
14 | | - | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | | - | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | | - | |
| 25 | + | |
20 | 26 | | |
21 | | - | |
22 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments