Skip to content

Make supervisor port takeover test await completion - #3674

Merged
ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-bb-app-supervisor-port-takeover-com-thr_nqdzf62pns
Sep 14, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-bb-app-supervisor-port-takeover-com-thr_nqdzf62pns

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The regression test added with #2994 raced the supervisor's real completion against an unrelated 250 ms timer. The loopback health probe and daemon termination are scheduler-dependent, so package-level CI contention could let the timeout win even though the supervisor correctly detected the healthy replacement server, sent the daemon SIGTERM, and resolved as stopped. This is the failure captured in CI run 34899568032 on unrelated UI-only PR #3639.

What changed

The port-takeover test now awaits the supervisor promise, which is the behavior's actual completion boundary. Its injected restart delay throws immediately if the supervisor enters the wrong retry path, so a regression fails without leaving blocked asynchronous work. The real ephemeral HTTP health server and the assertions for no restart plus daemon SIGTERM remain intact.

This is test-only. It changes no server/daemon wire field, CLI surface, or product behavior, so HOST_DAEMON_PROTOCOL_VERSION remains 207.

How you verified

  • Before the change on the frozen Intel base, 10 unloaded runs passed in 33–36 ms; 128 bounded CPU workers reproduced timeout versus stopped while the correct healthy-server stop branch logged, with the test taking 790 ms.
  • After the change, the same bounded 128-worker Intel stress passed in 690 ms on the host runtime and in 605 ms on Node 22.19.0 x64.
  • pnpm exec turbo run test --filter=bb-app --force under Node 22.19.0: 5 files, 81 tests passed.
  • pnpm exec turbo run typecheck --filter=bb-app --force under Node 22.19.0: 3/3 tasks passed.
  • pnpm exec turbo run build --filter=bb-app --force under Node 22.19.0: 48/48 tasks passed.
  • git diff --check origin/main passed.
  • All stress workers, Vitest workers, and Turbo/build processes were externally bounded and absent after their runs.

The complete repository-wide 92-package test matrix was not run locally; validation covered the changed bb-app package and its full forced build graph.

AGENT GENERATED: by GPT-5.6-Sol

@ymichael
ymichael merged commit c95c36c into main Sep 14, 2026
16 checks passed
@ymichael
ymichael deleted the bb/ci-flake-fix-bb-app-supervisor-port-takeover-com-thr_nqdzf62pns branch September 14, 2026 22:26
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