Repository navigation
Conversation
Contributor
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Make the stale-pipe-fd regression select the stdout socket rather than accidentally counting a newly initialized kqueue on macOS.
fstat()reports a kqueue as FIFO-shaped, so the fixture'sisFIFO() || isSocket()filter can find two candidates and fail before reaching FilePoll teardown.Bun creates subprocess stdout with a socketpair on these platforms. Filter for sockets, preserving the exact-one-candidate check, fd reuse check, and stale-registration teardown assertions.
Related: #31701 and #31821. Adapted from openclaw#147.
How did you verify your code works?
On upstream main
7c96a1212, a source-extracted fixture with a real kqueue opened between its descriptor snapshots fails before the patch withexpected exactly one new pipe fd; after the patch it printsOKand exits 0. The probe verifies the extra descriptor reportsisFIFO() === trueandisSocket() === false. This models lazy event-loop initialization without changing the runtime.The uninstrumented regression passes on the same upstream canary and on a fresh debug build of main: 1 test, 3 assertions.
bun bd test test/js/bun/spawn/spawn-pipe-stale-fd-unregister.test.ts