Repository navigation
test(server): run the real Hub project-packages suite in its own Bun process - #215
Merged
Merged
Conversation
…process
project-packages.test.ts failed intermittently in `tests (rest)` with three
different job errors ("process is unavailable or belongs to another Panel
App", "process stdin is unavailable", "Tool did not return a completed
result"). It passed 50/50 when run alone on the runner and failed in 3/8
and 1/10 full rest-shard runs.
Root cause, from instrumented runner runs with strace on close/epoll_ctl/
pidfd_open: late in the shard the single Bun process holds 1400-4500 open
descriptors and has spawned hundreds of children. Inside the synchronous
spawn path, Bun 1.3.11 on Linux closes the pidfd it has just opened
(pidfd_open = N, close(N) = 0, close(N) = EBADF twice) and then
epoll_ctl(ADD, N) fails with EBADF. Bun emits "EBADF: bad file descriptor,
epoll_ctl" as a child 'error' plus an exit with code null and closes the
stdio pipes while the real child keeps running; the executor's next
stdin write/end then finds the process gone. In the other variant a parent
stdio socket is closed under the child, so the fixture tool reads EOF and
answers before the Host has ended stdin. The same EBADF also failed an
unrelated Bun.spawn test in the shard (hub-automations lease test).
Product code is not involved: Hub and Desktop run on Node, and the
executor and process service behave correctly with intact descriptors.
Run this suite in its own Bun process, as the shard already does for
other suites that a long shared Bun process destabilizes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Runner verification (workflow_dispatch run 39719250655, diag branch): 10 parallel jobs, each running the full rest shard with the new ignore and then this suite alone 5 times. All 10 shards: 5625 tests, 0 failures. Isolated suite: 50/50 passes. Before the fix, the same rest shard failed this suite in 3/8 (run 39713091209) and 1/10 (run 39714111699) runs. |
This was referenced Oct 22, 2026
cjhyy
added a commit
that referenced
this pull request
Oct 22, 2026
gitOps.lsremote's "returns the HEAD sha" test failed in core-rest five times since 2026-10-21 (PR #214 among them, plus two main runs) with only "Expected: true, Received: false". Instrumented on the runner, the failure is `git ls-remote ... exited null`: git was killed by SIGPIPE 3-7ms after spawn, with empty stdout and stderr and no process.kill aimed at it. GIT_TRACE_PACKET shows the whole ls-remote exchange completed, including the final flush to upload-pack, so git died on its first write to its own stdout: the parent's read end was already gone. A plain node:child_process spawn of the same command fails the same way, so safeSpawn is not involved. This is the Bun 1.3.11 Linux bug already isolated in #215/#216: late in a long shard, Bun closes a just-created child descriptor during spawn. Measured on the runner: 9 failures in about 13,900 calls inside the core-rest shard, 0 in about 7,800 calls with the suite run alone. Run it alone, like knownMarketplaces, and compare the whole result so a future failure prints git's error rather than a bare false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 22, 2026
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.
Problem
packages/server/src/panels/project-packages.test.ts("real Hub HTTP serves and executes each project's retained package…") failed intermittently intests (rest). The task job failed with one of three errors:process is unavailable or belongs to another Panel Appprocess stdin is unavailableTool did not return a completed resultRoot cause (runner evidence)
errorevent wasEBADF: bad file descriptor, epoll_ctl, withexit(code=null)and the parent's stdin closed, while the real child kept running and printed its result later.close,epoll_ctl,pidfd_open,socketpair,vfork): late in the shard the single Bun process holds about 1400–4500 descriptors. Inside Bun's synchronous spawn path, the main thread does this:processes.end().EBADF ... epoll_ctlalso failed an unrelatedBun.spawntest in the shard (hub-automations.test.tslease test).The product code is not involved. Hub and Desktop run on Node, and the executor and process service behave correctly when their descriptors are intact. Recent Bun PRs fix similar double-close and fd-confusion bugs in spawn and IO (oven-sh/bun#38354, #43626, #43814). Upgrading Bun is a separate, repo-wide decision.
Fix
**/server/src/panels/project-packages.test.ts.reststep runs that suite in its own Bun process with the same 30s timeout. The shard already uses this pattern for other suites that a long shared Bun process destabilizes.Verification
bun run lint:workflow-test-pathspasses.Follow-ups (not in this PR)
🤖 Generated with Claude Code