Repository navigation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 This edit routes the test around a runtime bug instead of fixing it, so CI stops catching a hang that
bun testusers still hit.await expect(p).rejectscallswait_for_promise(src/runtime/test_runner/expect.rs:513), which re-entersus_loop_run_bun_tick; the nested tick overwritesready_polls,num_ready_pollsandcurrent_ready_poll(packages/bun-usockets/src/eventing/epoll_kqueue.c:536,550), so the outer dispatch loop at epoll_kqueue.c:260 exits early and the undispatched one-shot pipe polls are never read. Fix: make a nested tick preserve and dispatch the outer batch's remaining entries (or refuse to re-enter from dispatch), and keep a regression test for that path; the runtime defect itself is pre-existing.Why this was flagged
Any user test that reaches
expect(promise).rejectsor.resolvesfrom a socket/HTTP callback (a microtask continuation insideus_internal_dispatch_ready_polls) while another concurrent test awaitsproc.stdout.text()on aBun.spawnpipe.process_promiseat src/runtime/test_runner/expect.rs:507-513 callswait_for_promise, which loopstick()/auto_tick()(src/jsc/event_loop.rs:1141-1151);auto_tickcallstick_with_timeout(src/runtime/jsc_hooks.rs:1076) with no re-entrancy guard, andus_loop_run_bun_tickonly bumpstick_depth(epoll_kqueue.c:482) before overwritingloop->ready_polls/num_ready_pollsat epoll_kqueue.c:536 and resettingcurrent_ready_pollat :550. When the nested tick returns, the outerforat epoll_kqueue.c:260 compares the nested counters and exits, so the remaining outer entries are dropped; aBun.spawnpipe FilePoll is one-shot, so it is not reported again and the test's.text()never settles.Verification: normal (the user-facing hang itself is pre-existing on base; what this change introduces is routing the one test that exposes it around the runtime bug, which the repository's review instructions name as blocking: "Never edit a test to route around a runtime bug it exposed" and "Fix bugs at the layer that owns the violated invariant, never where the symptom appears") — acknowledged in diff: the PR description says "This only stops the file from running into that behaviour of the event loop", i.e. the author states the runtime defect is left in place; that claim is accurate.