Skip to content

Harden plugin host watch test startup wait - #2339

Merged
ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-plugin-host-watch-readiness-and-idl-thr_65ryz5fzcq
Aug 24, 2026
Merged

Harden plugin host watch test startup wait#2339
ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-plugin-host-watch-readiness-and-idl-thr_65ryz5fzcq

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

What was wrong

The PluginHostManager native-watch test launches a real plugin host worker, but it waited for host watch registration with Vitest's default one-second budget. Under scheduler and process contention, worker startup crossed that boundary before the watch could register. Test teardown then disposed the manager while manager.call was still pending, so the worker rejected that call and Vitest reported a secondary unhandled rejection. That rejection is test-cleanup fallout, not evidence of a production watch-disposal defect.

This matches the failure in PR #2337's unrelated CI run: readiness timed out at line 553, followed by the disposal rejection.

What changed

Give only the cross-process watch-registration wait an explicit five-second budget. The 20 ms idle timeout, 100 ms dwell, backpressure checks, disposal assertion, and all production behavior remain unchanged.

There are no host-daemon wire changes, so HOST_DAEMON_PROTOCOL_VERSION is unchanged. No CLI or documentation surfaces changed.

How you verified

  • Before the change, the focused test passed normally but failed at line 553 under 256 controlled CPU competitors, with the secondary unhandled rejection during cleanup.
  • After the change, the same contended command passed; the focused test took 1.95 seconds, beyond the former one-second readiness boundary.
  • plugin-host-manager.test.ts: 19/19 passed.
  • pnpm exec turbo run build --filter=@bb/host-daemon
  • pnpm exec turbo run typecheck --filter=@bb/host-daemon
  • pnpm exec turbo run test --filter=@bb/host-daemon --force: 44 files and 534 tests passed.

AGENT GENERATED: by GPT-5.6-Sol

@ymichael
ymichael merged commit b735da1 into main Aug 24, 2026
24 of 25 checks passed
@ymichael
ymichael deleted the bb/ci-flake-fix-plugin-host-watch-readiness-and-idl-thr_65ryz5fzcq branch August 24, 2026 16:58
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