Skip to content

test(account-pool): bound affinity eviction coverage - #3270

Merged
ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-account-pool-4096-session-lru-timeo-thr_ddaamdfhkd
Sep 8, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-account-pool-4096-session-lru-timeo-thr_ddaamdfhkd

Conversation

@ymichael

@ymichael ymichael commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The affinity-eviction integration test filled the production capacity by sending 4,095 sequential requests through the complete fake plugin host. Each request repeated parsing, account/quota selection, persistence, routing, and response consumption even though the eviction itself is an O(1) Map operation. On the untouched Intel baseline the single test took 10.7–12.2 seconds without real network I/O, leaving little headroom under its original 20-second timeout. The current-main failure ran the packages shard with four concurrent Turbo package tasks on four vCPUs while Account Pool Vitest also parallelized its ten files; that systemic nested CPU oversubscription made the serial test intermittently exceed 20 seconds. The merged 60-second timeout only masked this structural cost.

What changed

Thread an internal maxAffinityBindings construction option into the hub and apply the existing 4,096 production default once at that boundary. The end-to-end LRU test injects a capacity of four and keeps the same recency refresh, retention, next-oldest, and eviction assertions while removing 4,092 redundant HTTP requests. The custom 60-second timeout is removed, restoring the normal test timeout as the hang detector.

There are no CLI, user configuration, SDK, server/daemon wire, migration, or protocol-version changes.

How you verified

  • Before the change, the focused untouched-main case took 12,163ms unloaded and 10,700–10,820ms in two bounded contention samples; CI independently recorded the exact 20-second timeout under the packages shard.
  • After the change, the focused case passed in 125–131ms through Turbo on the rebased commit.
  • pnpm exec turbo run test typecheck --filter=bb-plugin-account-pool --concurrency=2 --force: 10 files and 261 tests passed; typecheck passed.
  • pnpm exec turbo run typecheck --filter=bb-plugin-account-pool --concurrency=2 --force: passed after rebasing onto current main.
  • pnpm exec turbo run build --filter=@bb/server --concurrency=2 --force: passed before and after the rebase.
  • Scoped Oxlint, Oxfmt check, and git diff --check: passed.
  • Final merge-base: d9f2ac5a4390b8b8507da3cc32a3bae01fc3f868.

AGENT GENERATED: by GPT-5.6-Sol

@ymichael
ymichael merged commit 8444c29 into main Sep 8, 2026
16 checks passed
@ymichael
ymichael deleted the bb/ci-flake-fix-account-pool-4096-session-lru-timeo-thr_ddaamdfhkd branch September 8, 2026 19:59
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