Skip to content

Load bridge host fixture natively in tests - #3745

Merged
ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-plugin-host-bridge-bundle-timeout-thr_czdudxph3t
Sep 15, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-plugin-host-bridge-bundle-timeout-thr_czdudxph3t

Conversation

@ymichael

@ymichael ymichael commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The published-bridge regression built a real 682 KB host artifact and then imported that generated artifact through Vitest's transform/module pipeline. The package already externalized builtin generated host artifacts for native Node loading, but the bridge fixture was omitted. On the contended package shard, the necessary esbuild lifecycle plus this avoidable second processing pass crossed Vitest's ordinary 5-second test boundary. The failing CI run reported 5.500 seconds; the unchanged test reproduced on the required Intel host at 5.142 seconds under 48 bounded CPU workers.

What changed

Load the generated bridge host artifact through a cache-busted file URL and include that fixture path in Vitest's existing native-artifact externalization rule. Declare the fixture package as ESM so Node loads the emitted ESM directly without reparsing or warning.

The real host build and all published bridge, bundled dependency, and executed SemVer assertions remain intact. There are no server/daemon wire changes, so HOST_DAEMON_PROTOCOL_VERSION does not change. PR #3681 is the only open PR touching packages/plugin-build; it changes the server builder and does not overlap these host-test files.

How you verified

  • CI evidence: https://github.com/get-bb/bb/actions/runs/35011632112, Tests (packages, ubuntu-latest, Node 22.x), exact 5.500-second timeout at build-plugin-host.test.ts:235.
  • Deterministic local red: unchanged test timed out at 5.142 seconds under 48 bounded CPU workers on Intel host_nwqfteeqz4.
  • Unloaded before/after: 1.281 seconds to 0.923 seconds.
  • Same-load before/after: 5.142-second timeout to 2.731 seconds; three further 48-worker runs passed at 2.755, 2.681, and 4.988 seconds.
  • Complete focused file: 9/9 tests passed; target completed in 871 ms.
  • pnpm exec turbo run test typecheck build --filter=@bb/plugin-build --output-logs=full: 9/9 Turbo tasks passed; package tests passed 139 tests with 1 skipped, and typecheck/build passed.
  • PR CI Node 22: the target passed in 2.720 seconds and all 139 @bb/plugin-build tests passed. The first run had unrelated Account Pool toast-test and runner-download failures; rerunning only the failed jobs passed, and CI run 35016480290 is green.
  • pnpm exec oxfmt --check packages/plugin-build/src/build-plugin-host.test.ts packages/plugin-build/vitest.config.ts and git diff --check passed.
  • Every load/test/build command had an external process-group deadline with TERM/KILL cleanup. Post-run survivor scans were empty.

AGENT GENERATED: by GPT-5.6-Sol.

@ymichael
ymichael merged commit f39c35a into main Sep 15, 2026
24 of 26 checks passed
@ymichael
ymichael deleted the bb/ci-flake-fix-plugin-host-bridge-bundle-timeout-thr_czdudxph3t branch September 15, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant