Stabilize host-daemon crash/stop race test - #2341
Merged
ymichael merged 1 commit intoAug 24, 2026
Merged
Conversation
ymichael
deleted the
bb/ci-flake-fix-thread-stop-crash-mid-turn-timeout-thr_kdfmti3e2q
branch
August 24, 2026 16:57
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.
What was wrong
The real-process crash/stop coverage serialized two independent plugin-bridge Node startups: it fully started an unused healthy thread before launching the provider that crashes mid-turn. Under the 73-package, 4-vCPU CI shard, that additive startup latency consumed the test's unchanged 15-second wall-clock budget; the unrelated PR #2337 run exposed a 15.292-second outlier. The test then polled a process-exit callback with a second fixed timeout even though the runtime already reports that transition directly.
What changed
The test now creates the environment without an unused healthy provider session, starts the required healthy keepalive process concurrently with the crashing provider, and awaits the runtime's unexpected-process-exit callback directly. It still launches both real provider subprocesses, proves the process died with an active turn, verifies runtime-owned cleanup and the synthesized failed completion, asserts the original environment entry stayed loaded, and confirms the later stop never reached a provider. The 15-second test budget and all crash/stop assertions remain unchanged. This is test-only, so there is no host-daemon protocol change.
How you verified
pnpm exec turbo run typecheck --filter=@bb/host-daemon --forcepnpm exec turbo run build --filter=@bb/host-daemon --forcepnpm exec turbo run test --filter=@bb/host-daemon --force(44 files, 534 tests)