Skip to content

test: parallelize the integration pool and stop rebuilding shared artifacts - #25

Merged
ScriptedAlchemy merged 5 commits into
test/prune-low-value-testsfrom
test/parallelize-integration-suite
Aug 29, 2026
Merged

test: parallelize the integration pool and stop rebuilding shared artifacts#25
ScriptedAlchemy merged 5 commits into
test/prune-low-value-testsfrom
test/parallelize-integration-suite

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • Core-derived parallelism. rstest.integration.config.ts now computes pool.maxWorkers as max(1, min(4, floor(availableParallelism() / 2))) (still 1 on two-core CI; AGENT_BUNDLE_INTEGRATION_MAX_WORKERS overrides it), and the redundant --pool.maxWorkers 1 CLI flag is gone from test:integration:run.
  • Serial pool for shared-artifact writers. rstest's per-project config cannot set pool/isolate, so the split is two chained configs: the parallel pool runs the 52 files that only use mkdtemp fixtures, ephemeral ports (port: 0 / rsbuild silent free-port), and read-only prebuilt dists; rstest.integration-serial.config.ts then runs the two files that rewrite shared state — inspector-shell.e2e (development-mode rebuild of packages/workbench/dist is under test) and packed-release.e2e (root build fallback + npm pack + pre-reserved port). Per-file module isolation (isolate: true default) is preserved for the log pipeline suites.
  • Prebuild once instead of rebuilding. overview.e2e (up to 10 builds/run), mcp-app-real.e2e (2), and playground-real.e2e had local buildWorkbench copies that ignored AGENT_BUNDLE_WORKBENCH_PREBUILT; they now use the shared memoized helper. cli.test and the packed-release harness honor a new AGENT_BUNDLE_PACKAGE_PREBUILT flag, with test:integration running one root pnpm build up front. With their shared-dist writes gone, all four moved to the parallel pool.
  • Injectable retention window. The RSC example session takes a test-only maximumRunHistory through its start testing seam; the consolidated eviction test drives a 5-run window instead of 50 real invocations and asserts the production default is still 50.
  • Contention hardening. Parallel workers double the timeScale polling budgets (the mechanism CI already uses on two-core runners) and the parallel pool raises the 5s default test timeout to 30s; explicit per-test timeouts are unaffected.

Measured times (96-core machine, background load avg ~22-25 from other jobs)

Run Wall clock
Profiling baseline (base branch, serialized pool) ~10.5 min
This branch, forced serial (AGENT_BUNDLE_INTEGRATION_MAX_WORKERS=1, CI mode) 14:02 — all 54 files / 540 tests pass, no regression
This branch, parallel (4 workers) 4:15 — all pass
pnpm test:unit 1:19 — 1656 tests pass

The parallel run is ~3.3x faster than the same-machine serial run (~2.5x vs the quoted baseline; this machine was under heavy background load during measurement, which also inflates the serial number relative to the profiling pass).

Test plan

  • pnpm typecheck and pnpm lint after each commit
  • Full pnpm test:integration:run forced serial (CI shape) — green
  • Full pnpm test:integration:run parallel — green
  • pnpm test:unit — green
  • Consolidated eviction test alone with the 5-run window — green

…ifact writers into a serial pool

The parallel pool runs mkdtemp-fixture, ephemeral-port files on
min(4, cores/2) workers (still 1 on two-core CI, overridable via
AGENT_BUNDLE_INTEGRATION_MAX_WORKERS); the six files that rewrite shared
package dists stay on one worker in a chained serial config.
overview.e2e, mcp-app-real.e2e, and playground-real.e2e now use the shared
memoized buildWorkbench (which honors AGENT_BUNDLE_WORKBENCH_PREBUILT)
instead of local copies that rebuilt packages/workbench/dist up to ten
times per run; cli.test and the packed-release harness honor a new
AGENT_BUNDLE_PACKAGE_PREBUILT flag, with `test:integration` building the
whole workspace once up front. With those writes gone, the four files
move from the serial pool to the parallel one.
…o the eviction suite

The session accepts a test-only maximumRunHistory through its start
testing seam; the consolidated eviction test drives a five-run window
instead of fifty real invocations and asserts the production default is
still fifty.
…rallel workers

Concurrent Chrome + dev-server + rsbuild pairs contend for cores, so the
parallel config doubles timeScale for its workers and the e2e suites with
previously unscaled budgets now honor it (same mechanism CI already uses
on two-core runners).
Real in-process example builds can exceed the 5s rstest default when four
workers share the machine; explicit per-test timeouts are unaffected.
@changeset-bot

changeset-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bfed755

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T03:09:29.378771Z bfed755 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Aug 29, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@25
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/rsc-runtime@25

commit: bfed755

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bfed7558e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rstest.integration-tests.ts
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