Skip to content

Stabilize host-daemon crash/stop race test - #2341

Merged
ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-thread-stop-crash-mid-turn-timeout-thr_kdfmti3e2q
Aug 24, 2026
Merged

Stabilize host-daemon crash/stop race test#2341
ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-thread-stop-crash-mid-turn-timeout-thr_kdfmti3e2q

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

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

  • Before: a warm one-process case took 455ms, while the serialized crash case took 1,062ms; under 96 controlled CPU competitors the crash case took 2,189ms. A cold focused run took 6,060ms.
  • After: the focused crash case took 421ms, the complete race file passed all 4 cases (the warm crash case took 128ms), and the matching 96-worker contention run passed in 1,900ms without widening the timeout.
  • pnpm exec turbo run typecheck --filter=@bb/host-daemon --force
  • pnpm exec turbo run build --filter=@bb/host-daemon --force
  • pnpm exec turbo run test --filter=@bb/host-daemon --force (44 files, 534 tests)

AGENT GENERATED: by GPT-5.6-Sol

@ymichael
ymichael merged commit d027607 into main Aug 24, 2026
15 checks passed
@ymichael
ymichael deleted the bb/ci-flake-fix-thread-stop-crash-mid-turn-timeout-thr_kdfmti3e2q branch August 24, 2026 16:57
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