Skip to content

Stabilize provider installation deadline test - #3296

Merged
ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-provider-installation-aggregation-t-thr_nwzisfpq63
Sep 8, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-provider-installation-aggregation-t-thr_nwzisfpq63

Conversation

@ymichael

@ymichael ymichael commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The provider-installation deadline regression combined three independent layers in one 5-second test body: a full server route harness, provider registry setup, and retryable host RPC timers. It scheduled every stalled wire attempt with fake setTimeout, then advanced the entire harness clock by 150 seconds even though the aggregate policy only needs to model three concurrent provider requests across a 70-second budget. Under normal server-shard CPU contention, processing that avoidable timer/lifecycle work could consume the test's real 5-second ceiling. This recurred on current main at cb3aaf57ddf46ec9cd27e18fc4d99084fb75917e (run 34277635721, job 102235437825) and on unrelated PR #2920 (run 34277790348, job 102234989200). Retryable RPC attempt budgeting is already covered by online-rpc.test.ts, so replaying both attempts for every provider here duplicated coverage while making the aggregation regression timing-sensitive.

What changed

  • Extracted the existing provider aggregation policy into aggregateProviderInstallations: it preserves three-way concurrency and registry order, prepares each provider request, applies the remaining aggregate budget, omits providers after the deadline, and assembles the response.
  • Kept getProviderInstallations responsible for provider discovery, bridge resolution, host RPC dispatch, error classification, and logging. Its 70-second production deadline and 30-second command ceiling are unchanged.
  • Reworked the deadline regression to drive the production aggregation helper through observable batches of three deferred provider requests. The test advances an injected logical clock once per concurrent batch, resolves every deferred request, and still proves an empty result, nine provider requests, a shortened final request budget, completion at 70 seconds before the SDK's 75-second deadline, and omission of providers 10 and 11.
  • No host-daemon wire, SDK, CLI, route, request deadline, retry budget, or test timeout changed.

How you verified

  • Current-main red: the exact test failed at 5,063ms under a bounded 48-hog profile on an 8-logical-CPU Intel host (at least 50 runnable compute processes, 6.25x oversubscription). Five unloaded current-main runs took 695-1,157ms in the test body.
  • Matched green: the rewritten test passed in 13ms under the same 48-hog profile and in 5ms without generated load. Every load/test harness had a hard deadline and process-group cleanup; survivor checks were empty.
  • pnpm exec turbo run test --filter=@bb/server -- test/public/public-provider-installations.test.ts passed: 1 file, 6 tests.
  • pnpm exec turbo run typecheck build --filter=@bb/server passed both server tasks.
  • A serial one-worker rerun passed online-rpc.test.ts (9 tests), plugin-update.test.ts (27), timeline-in-turn-window.test.ts (28), and timeline-perf.test.ts (1); one unrelated macOS launch-agent test timed out while the Intel host's virtualization workload remained elevated.
  • Three broader server runs all passed public-provider-installations.test.ts (6 tests). The full shards did not go green on this host: depending on worker count and concurrent virtualization load, unrelated install/plugin/timeline tests hit their existing 5-second ceilings (best run: 4 failed files, 18 failed and 2,310 passed tests). The server package itself used seven Vitest workers plus one coordinator on eight logical CPUs, so it did not oversubscribe the host by itself.
  • pnpm exec prettier --check apps/server/src/services/system/provider-installations.ts apps/server/test/public/public-provider-installations.test.ts and git diff --check passed.

AGENT GENERATED

@ymichael
ymichael force-pushed the bb/ci-flake-fix-provider-installation-aggregation-t-thr_nwzisfpq63 branch from 8245819 to 14c16df Compare September 8, 2026 23:23
@ymichael
ymichael merged commit 05b44c4 into main Sep 8, 2026
16 checks passed
@ymichael
ymichael deleted the bb/ci-flake-fix-provider-installation-aggregation-t-thr_nwzisfpq63 branch September 8, 2026 23:27
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