ci: move the CI test toolchain to Bun 1.4.2 - #3265
Merged
Merged
Conversation
The docs Playwright job timed out in the webServer on roughly one E2E run in fifteen (3 of the last 40, twice in a row on #3262): the client build printed the PWA plugin's "files generated" and then nothing followed for the rest of the 240 s budget — `vite preview` never started, so zero tests ran. The build's own work was complete; the process hung inside the explicit `process.exit(0)` that build-client.ts fires after `build()`. Bun 1.4.1 names the cause: on the main thread, `process.exit()` used to run N-API addon finalizers and cleanup hooks and could hand a still-queued threadsafe-function call a null env. rolldown, which Vite 8 builds with, is exactly such an addon. 1.4.1 skips them, as Node does. CI pinned 1.3.12 through the setup-turbo composite action; the pin moves to 1.4.2. The two comments that explained the hang as a dangling event-loop handle now state the real dependency. Under Bun 1.4.2, `bun install --frozen-lockfile --dry-run` resolves the lockfile and the docs Playwright suite passes 3/3 with CI=1. Left alone on purpose: the release/build/cli workflow pins and the Dockerfiles (they ship binaries and runtime images), security.yml's 1.4.0 audit pin, and package.json's packageManager field.
Turbo's task hash ignored the Bun version, so a pin bump could be masked by replayed logs: on #3265's first run the CLI unit task was a cache hit from a 1.3.12 run and never executed under 1.4.2. The setup-turbo action file is now a global dependency, so changing its pin reruns every cached task under the new toolchain.
The audit gate pinned 1.4.0 as 'deliberately newer than the build jobs'; with the test toolchain at 1.4.2 that pin was the older one. Same pin as setup-turbo now; the audit's own floor (1.4, for bun audit --prod on a workspace root) still holds.
The failing logs stop at the PWA file list, which rolldown prints from inside its native close; the rest of that close, build() returning, process.exit(0) and the preview's start all sit in the unobserved 0.8 s window. The comments now say the evidence places the stall at the exit rather than stating it, and build-client.ts logs one line after build() resolves so any future stall lands on one side of the exit.
turbo.json already carried a globalDependencies list further down; the key added at the top was a duplicate the parser dropped (last key wins), so the CLI test task kept main's hash and replayed a 1.3.12 log a second time. The action file now sits in the one list, and Turbo's dry run shows it among the global files.
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.
Why
The docs Playwright job (E2E workflow,
Playwright (docs)) times out in Playwright'swebServeron roughly one run in fifteen — 3 of the last 40 E2E runs, and twice in a row on #3262 (runs 34011390460 attempts 1+2, and 34007884968 on another branch). The failing logs all stop at the same line: the client build prints the PWA plugin'sfiles generated, then nothing follows for the remaining ~3m50s of the 240 s budget.vite previewnever prints its banner, so zero tests run.The PWA file list is printed from inside rolldown's native close, so the rest of that close,
build()returning, the explicitprocess.exit(0)inservices/docs/scripts/build-client.ts, the shell&&andvite preview's start all sit in the unobserved window (0.8 s in a passing run). The evidence places the stall at the exit: the natural-exitvite buildpath that runs the samebundle.close()is green across the sampled Build history, web's identicalvite previewnever stalled, and Bun 1.4.1 names an exit-time hang in exactly this addon class.Root cause
Bun v1.4.1's release notes (2026-09-04):
rolldown — what Vite 8 builds with — is an N-API addon whose JS plugin bridge runs on threadsafe functions. CI ran Bun 1.3.12 through the
setup-turbocomposite action's default, so every docs build exited through that path; under runner contention it occasionally never came back. The pre-#2982vite buildCLI "never exits after a successful build" hang is the same class (natural exit runs the same teardown).Change
.github/actions/setup-turbo/action.yml: defaultbun-version1.3.12→1.4.2(current release, 2026-09-05), with the floor documented in place. This is the pin behind Checks, E2E, Commitlint and the two Build jobs that call the action without a version.services/docs/scripts/build-client.ts,services/docs/playwright.config.ts: the comments that explained the hang as a dangling event-loop handle now state the real dependency.Deliberately left alone (release-engineering decisions)
build.yml/release.yml(1.3.12) andcli.yml(1.3.13) — they compile the shipped CLI binaries.oven/bun:1.3.12in web, docs, sandbox, plop template) — runtime images; theDocs container testjob shows no failures in the last 25 Build runs.security.yml's 1.4.0 audit pin (ci: harden the bun audit gate (bun 1.4.0, registry retries, timeout) #3211) andpackage.json'spackageManager: bun@1.3.10.Verification
bun install --frozen-lockfile --dry-runresolves the lockfile;CI=1 bun run --filter @tale/docs test:e2e→ build,➜ Local: http://localhost:3002/, 3 passed.oxfmt --checkclean on the changed files.Review follow-ups (adversarial review: approve, advisory only) — 1034184
Turbo cache (
turbo.json): the task hash ignored the Bun version, so this PR's first CI run replayed the CLI unit task from a 1.3.12 cache (bun test v1.3.12in the log) and never executed it under 1.4.2..github/actions/setup-turbo/action.ymlis now inglobalDependencies, so a pin change reruns every cached task. (First attempt added a second top-levelglobalDependencieskey that the parser dropped, so 1034184 replayed the same 1.3.12 log again; 3abb75b puts the file in the existing list and Turbo's dry run shows it among the global files — that push is the first run where the CLI tests execute under 1.4.2 in CI.) (The reviewer rantools/cliunder 1.4.2 locally meanwhile: 334 pass / 18 skip / 0 fail.)Audit gate (
security.yml): its 1.4.0 pin, documented as "deliberately newer than the build jobs", was now the older one; aligned to 1.4.2 with the comment corrected.Wording: comments, this body and the follow-up commit state that the evidence places the stall at the exit instead of asserting the site.
build-client.tsnow logs[build-client] build resolved, exiting 0afterbuild()resolves, so any future timeout lands on one side of the exit.Not addressed here: Storybook (also a Vite/rolldown build under
--bun) is path-filtered off this PR and gets its first 1.4.2 observation with the next UI change; the repo-wide dev floor stays "Bun >= 1.3" (local runs skip the build chain viareuseExistingServer).Fifth occurrence while this PR was open: run 34016343826 on fix(platform): claim message slots until a deadline, not a fixed count #3267 (a platform-only change, no docs content touched) —
bun-version: 1.3.12,files generated, then the 240 s timeout. Same shape, unrelated content.Observed on 3abb75b: the Checks Unit job ran with zero cache replays —
@tale/cli:testwas a cache miss and executed underbun test v1.4.2, as did every other Bun-native suite.Sixth occurrence: run 34017745677 on fix(platform): claim message slots until a deadline, not a fixed count #3267's polish head (platform-only again) —
bun-version: 1.3.12,files generated, 240 s timeout. Under 1.3.12 the docs job has now stalled on 6 of today's runs; on this PR's three 1.4.2 heads it passed 3 of 3.