Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion test/js/bun/spawn/spawn-streaming-stdin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@
remaining -= concurrency;
}

const newMaxFD = getMaxFD();
// Pipe fds are closed on a background thread after their streams finish, so
// the last batch's closes may still be in flight here; wait for them to land.
let newMaxFD = getMaxFD();
for (let i = 0; i < 100 && newMaxFD !== maxFD; i++) {
await Bun.sleep(10);
newMaxFD = getMaxFD();
}

Check warning on line 72 in test/js/bun/spawn/spawn-streaming-stdin.test.ts

View check run for this annotation

Claude / Claude Code Review

Sibling spawn-streaming-stdout.test.ts has the same unfixed getMaxFD() race

The sibling test `spawn-streaming-stdout.test.ts:46-47` has the identical `await Promise.all(...) → getMaxFD() → expect(newMaxFD).toBe(maxFD)` pattern with `stdout: 'pipe'`, so the same `bun_io::Closer` background-close race applies there — and its baseline is captured *after* batch 1's `Promise.all` (lines 42-44), which adds an inflated-baseline failure mode. Per REVIEW.md's "fix the whole class in the same PR" rule, consider applying the same bounded poll there, or noting in the PR why it's ex
Comment thread
robobun marked this conversation as resolved.
Resolved

// assert we didn't leak any file descriptors
expect(newMaxFD).toBe(maxFD);
Expand Down
Loading