Skip to content

perf(test): drop rstest maxWorkers pins, isolate per RSTEST_WORKER_ID - #90

Closed
ScriptedAlchemy wants to merge 1 commit into
mainfrom
perf/rstest-auto-workers
Closed

perf(test): drop rstest maxWorkers pins, isolate per RSTEST_WORKER_ID#90
ScriptedAlchemy wants to merge 1 commit into
mainfrom
perf/rstest-auto-workers

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Why

Worker pins are gone.

Rstest sizes the pool from CPU. Shared roots are isolated per RSTEST_WORKER_ID.

Unit isolate is off. Integration isolate stays on because logs-real.e2e fails when sharing a worker.

Local proof: unit 1775 passed in ~75s. Integration 556 passed in ~200s. Packed 22 passed, 1 skipped, ~56s.

No changeset. examples/rsc-agent-runtime untouched.

@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7578a38

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 31, 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-31T20:58:07.030386Z 801fe49 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.

@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: 801fe49aec

ℹ️ 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.config.ts
Comment thread rstest.runtime-playground.browser.config.ts
@pkg-pr-new

pkg-pr-new Bot commented Aug 31, 2026

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

commit: 7578a38

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Superseded by #118, which merges this branch's per-RSTEST_WORKER_ID isolation intact (commit 7578a38 carried over unchanged) and adds the root-cause fixes for the flakes the serial pin was hiding, plus the burn-in-backed integration worker derivation. Credit for the isolation design and the unit/packed/watch pool unpinning stands — #118 is the single coherent landing of both efforts.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Merge conflict resolution (origin/main @ 8bf9618 merged in 458af9c)

The three conflicted files (dev-workbench-packaging.test.ts, public-api-packed.test.ts, rsc-runtime-optional-packaging.test.ts) all conflicted on the same pattern: this branch's install sites pass env: installedEnvironment() / isolatedCommandEnvironment() (per-RSTEST_WORKER_ID npm cache/tmp isolation), while main (#109) switched the same sites from npmInstallArguments to cachedNpmInstallArguments (--prefer-offline for consumer-contract installs). The resolution keeps both: every install site in these files now spreads cachedNpmInstallArguments and keeps this branch's isolated environment. All six installs across the three files are in #109's cached/consumer-contract category, so no site here uses the default list. tests/support/shared-pack.ts auto-merged cleanly and exports both argument lists on top of this branch's shared-tarball/worker-isolation plumbing.

Verified in a fresh worktree at the merge: typecheck, lint, pnpm test:packed (multi-worker, green), pnpm test:unit (green).

Codex P1: browser pool setup (fixed in 7e6cb02)

Confirmed empirically — rstest run --config rstest.runtime-playground.browser.config.ts failed to build (Reading from "node:fs" is not handled by plugins, 0 tests ran, exit 1) because rstest.setup.ts is bundled into the browser page. Browser projects now load a new empty rstest.setup.browser.ts, and rstest.runtime-playground.config.ts scopes the Node setup to its runtime-node project. Post-fix the browser pool is green (2 passed, exit 0).

BLOCKER: unpinned integration pool races on the shared example dist

pnpm test:integration:run on a fresh checkout of this branch fails with shared-fixture corruption in examples/rsc-agent-runtime/dist:

  • Run 1: overview.e2e.test.ts (ENOENT dist/runtime/runtime-assets.json mid-build) and runtime-playground-capture.test.ts (ENOTEMPTY rmdir dist/app).
  • Run 2 (dist removed to re-arm): runtime-playground.e2e.test.ts (ENOENT lstat dist/app during the fixture's cp).
  • Control: origin/main @ 8bf9618, same machine, dist removed — 556 passed, 0 failed.

Mechanism: packages/workbench/tests/helpers/runtime-playground-fixture.ts ensureRuntimeExamplePayload() probes dist/{app,runtime} and runs rsbuild build --mode production into the shared workspace example when absent, with no cross-worker lock. Six test files use this fixture; the unpinned pool starts them simultaneously, so concurrent rsbuild cleans/writes corrupt each other. Main's 4-worker cap masked the window. The race only arms when the example dist is absent — i.e. exactly what fresh CI checkouts do — so a green run on a warm tree is not evidence it's fixed. It needs the same treatment this PR gave the packed suites (build once before the pool, or per-worker/locked payload builds) before it can land.

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