fix(run): wait for the runner's count before the next test under --max-failures
BA
9h ago+178+178+012345678901234567890123456789-46-46-01234567890123456789
What and why
- The scheduler is now the only owner of the failure count.
RunUnitMessage.failureLimitis just a flag that the run has a limit; the snapshot ({ limit, failures }) and the worker's owncountFailurearithmetic are gone. - While the run has a limit, a worker that reports a counted failure waits before its next test (
TargetExecutorOptions.beforePair, also before each setup pair) until the runner answers. The answer is a newcontinuemessage when the run is still below the limit, or the existinginterruptwith thefailure-limitskip once it is reached. One round-trip per failure, no timing. - The worker counts the failure before it emits the result, because an in-process runner answers inside
emit. - Patch changeset for
e2e. No docs change:docs/reference/cli.mdxalready describes the fixed behavior.
Issue
Fixes #1745
Verified
Ran it locally: yes
- New 2-worker,
maxFailures: 2test inparallel-workers.test.ts: fileafails at once, filebfails 500 ms later, sob's worker trips the limit. It asserts the rest of the tripping file is skipped withfailure-limit(nointerrupted), and at most oneinterruptedoverall. It fails 3 of 3 runs against amainbuild and passes 5 of 5 here.
| main | this branch |
|---|---|
b next interrupted (started after the limit, then cancelled) | b next and b last skipped, failure-limit |
vitest run tests/unit: 3653 pass.vitest run tests/integration: 972 pass, 3 fail incli-init.test.tsonly because@e2e-dev/mobilewas not built locally (same onmain).pnpm checkgreen.
Checklist
- Changeset added (
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only. - Breaking change: title carries
!, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md). - Docs updated in the same PR: the
docs/**/*.mdxpage for the behavior, andskills/e2e/if the skill describes it. - Contract change: emitted
.d.tsreviewed,tests/types/sdk-types.tsupdated; wire change edits the schema and both fixtures. - Engine contract change (
e2e/engine): changesets fore2e,@e2e-dev/web, and@e2e-dev/mobile.