Load built host artifacts natively in tests - #2507
Merged
ymichael merged 1 commit intoAug 27, 2026
Merged
Conversation
ymichael
deleted the
bb/ci-flake-fix-keep-awake-builtin-host-artifact-ti-thr_b2bd5w6a77
branch
August 27, 2026 16:06
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.
Human comments
What was wrong
builtin-host-artifacts.test.tsbuilds final, self-containedhost.jsfiles and then dynamically imports them inside Vitest. The package left those generated artifacts inline in Vitest's module runner, so Vite parsed and transformed the already-built provider bundles again instead of handing them to Node's native loader as the daemon does. Under package-shard CPU oversubscription, that avoidable second pass stretched the Keep Awake case past its 20-second budget; Vitest timed the case out without cancelling its in-flight import, which then continued into later work. The independently verified merge base for this fix is524b2fe4b0df74185bdd29a274fb77cd6765b2b3.What changed
.builtin-host-test-*/dist/host.jsin@bb/plugin-build's Vitest configuration so the final ESM artifact is loaded natively.How you verified
TMPDIR=/private/tmp pnpm exec turbo run test --filter=@bb/plugin-build --force --env-mode=loose— 10 files passed, 134 tests passed, 1 skipped.TMPDIR=/private/tmp pnpm exec turbo run test --filter=@bb/plugin-build --force --env-mode=loose -- --coverage— same tests passed with V8 coverage enabled.pnpm exec turbo run typecheck --filter=@bb/plugin-build --force— 4/4 tasks passed.pnpm exec turbo run build --filter=@get-bb/plugin-sdk --force— 2/2 tasks passed; 17 runtime entries built.pnpm exec oxfmt packages/plugin-build/vitest.config.ts --check.