Skip to content

fix(check): honor Vitest worker configuration - #2437

Merged
thymikee merged 2 commits into
callstack:mainfrom
PLASMA-FR:fix/affected-worker-override-a-20260910
Sep 10, 2026
Merged

fix(check): honor Vitest worker configuration#2437
thymikee merged 2 commits into
callstack:mainfrom
PLASMA-FR:fix/affected-worker-override-a-20260910

Conversation

@PLASMA-FR

@PLASMA-FR PLASMA-FR commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

AGENT_DEVICE_VITEST_MAX_WORKERS configures Vitest, but check:affected appended --maxWorkers=4, overriding it. Delegate worker sizing to vitest.config.ts so its default, validated local override, CPU clamp, and CI policy apply. This completes the propagation boundary introduced in #1964.

Also address the maintainer's Coverage request by freezing the default readiness-budget test's clock. Its exact 120,000 ms assertion was racing real time across async mock calls. The test now uses the same clock discipline as its neighboring deadline cases.

Four files, +24/−29; the review follow-up adds only the readiness test fix.

Validation

Tested commit: 704b15b87e47b72765bd18bc5aafb269abdf0d53 (Node 24.13.1, pnpm 11.17.0, Linux).

  • Current-main real-clock probe observed 119,998 ms. Controlled clock perturbation failed before the fix and passed after it.
  • Readiness and hermetic worker-policy suites: 14 passed.
  • pnpm check:affected:test: 65 passed.
  • AGENT_DEVICE_VITEST_MAX_WORKERS=1 pnpm check:affected --run: all runnable gates passed, including build, lint, types, package, integration, and compatibility checks.
  • Full local coverage: 10,033 passed; two failures reproduced on unchanged main (umask 0077 masks file mode; fabricated PID 101 is live here). Readiness: eight passed under instrumentation.
  • Authoritative upstream Coverage and Integration Tests: pending on this head.

@PLASMA-FR

Copy link
Copy Markdown
Contributor Author

Coverage completed 10,034 tests and failed only the unchanged packages/platform-apple/src/readiness/runtime.test.ts default-budget assertion: it observed 119,999 ms instead of 120,000 ms. This PR changes only scripts/check-affected/{checks,model.test,run.test}.ts, and the corresponding local exact-head affected gate passed. As an external contributor I cannot rerun the upstream Actions job (GitHub returns 403); could a maintainer please rerun the failed Coverage job? Failed job: https://github.com/callstack/agent-device/actions/runs/34449654022/job/102782254533

@thymikee

Copy link
Copy Markdown
Member

No code findings at bce5469. Removing the command-line override correctly leaves worker sizing with Vitest configuration, and the regression assertions cover that boundary. The Coverage failure looks unrelated: it runs Vitest directly, not check:affected, and failed an unchanged readiness assertion by one millisecond. Ready for human review; a green Coverage rerun is still needed before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 10, 2026
@thymikee

Copy link
Copy Markdown
Member

Please fix coverage

@thymikee
thymikee merged commit 8dd1f6c into callstack:main Sep 10, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants