Skip to content

fix: run concrete changed test groups concurrently - #162701

Merged
shakkernerd merged 1 commit into
mainfrom
fix/affected-test-runtime
Oct 1, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
fix/affected-test-runtime

Conversation

@shakkernerd

@shakkernerd shakkernerd commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #162615

What Problem This Solves

pnpm test --changed <base> serializes independent test groups even when it resolves to the same concrete files that receive automatic concurrent scheduling in an explicit-file invocation. The admission check previously required original file arguments, which changed-mode commands do not contain.

User Impact

Eligible concrete changed selections now use the existing bounded scheduler. Existing worker budgets, serial overrides, exclusive-suite barriers, output/cache isolation and child cleanup remain in force. Test selection policy and command defaults are unchanged.

Why This Change Was Made

The execution owner can already distinguish resolved changed files from broad/configuration selections. It now admits the resolved literal files through the same checks used for explicit targets. This is a scheduling correction in the existing runner, with two regression cases added to its current admission matrix.

Evidence

The baseline regression recorded one active plan where the existing resource profile permits two. The corrected changed-mode case reaches two, while the serial-override control remains at one. Remote affected coverage passed across 16 files: 778 cases passed and 1 existing case skipped. Changed-file lint/format and the scripts/root compiler graphs passed, along with the production dependency audit and trusted-base private-key scan. A corrected assertion was rerun with its failed owner and two previously unrun smoke files; the 13 passing peer files were retained.

The complete regression file passed its 176 cases in 29.82s in one Vitest file worker. The affected runner used two concurrent plans with four workers per plan on an 8-CPU/31-GiB remote box. The 3-file completion took 102.42s, including native preparation. These measurements do not claim CPU saturation or a universal wall-time reduction. Hosted CI passed on fd6430302c55dafb2181f024e56e333638643b08; ClawSweeper rated that same head Platinum with no findings. Independent engineering review is clean.

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Oct 1, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 9:03 AM ET / 13:03 UTC (Revision 2).

ClawSweeper review

What this changes

The PR lets resolved changed test files use the existing bounded concurrent scheduler and adds regression cases for overlap and the serial override.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix: current main still excludes concrete changed selections from automatic overlap. No actionable correctness or security findings remain, and the overlapping open PR also changes selection policy rather than demonstrably superseding this work.

Priority: P2
Reviewed head: fd6430302c55dafb2181f024e56e333638643b08

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful regression coverage and no supported blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored PR. The body reports the changed execution owner's remote overlap behavior and serial control; mocked admission regressions and CI are supplemental. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored PR. The body reports the changed execution owner's remote overlap behavior and serial control; mocked admission regressions and CI are supplemental. No stored-data contract changes.
Evidence reviewed 7 items Pinned introduction and merge composition: The introduced delta changes admission and its existing regression matrix. The independently inspected test-merge raw parents match the pinned base followed by the exact PR head, and its production delta matches the introduced admission change.
Current main still needs the repair: Current main requires original targetArgs.length before setting exactTargetRun. Changed-mode selections resolve separately and therefore cannot receive this automatic admission. This was source inspection, not an executed reproduction.
Existing safety checks remain authoritative: The execution owner still requires CI-like execution, joined process groups, safe output, scheduler-owned caches, and no explicit serial override. The shared scheduler retains its resource-dependent cap of two and drains ordinary spans around exclusive plans; changed-mode admission does not install explicit-file no-tests failure semantics.
Findings None None.
Security None None.

How this fits together

OpenClaw's test runner turns explicit files or changed Git paths into test groups, then schedules their Vitest processes. Admission checks control concurrency while preserving resource limits, isolated outputs and caches, and exclusive-suite barriers.

flowchart TD
  A[Explicit files or changed paths] --> B[Resolve test groups]
  B --> C[Check concrete file selection]
  C --> D[Check resources and isolation]
  D --> E[Bounded scheduler]
  E --> F[Vitest processes]
  F --> G[Joined cleanup and results]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +12, Other +2. Total +14 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 14 2 +12
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 8 6 +2
Total 2 22 8 +14

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #162615
Summary: This PR directly targets the canonical scheduling defect; another open candidate combines that repair with a separate selection-policy change.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep changed-file scheduling parity in the existing execution owner while preserving test selection, serial overrides, and isolation contracts.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes that eligible changed selections lack original explicit targets and fail automatic-overlap admission on current main; the reported Linux comparison supplies a concrete reproduction path, which this review did not execute.

Is this the best way to solve the issue?

Yes, admitting resolved literal files through the existing execution owner repairs scheduling parity without adding a scheduler or changing selection policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9bf17b16a878.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Avoidable serialization affects developer test execution without evidence of an urgent product-runtime failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this MEMBER-authored PR. The body reports the changed execution owner's remote overlap behavior and serial control; mocked admission regressions and CI are supplemental. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduction and merge composition: The introduced delta changes admission and its existing regression matrix. The independently inspected test-merge raw parents match the pinned base followed by the exact PR head, and its production delta matches the introduced admission change. (scripts/test-projects-run.mts:395, fd6430302c55)
  • Current main still needs the repair: Current main requires original targetArgs.length before setting exactTargetRun. Changed-mode selections resolve separately and therefore cannot receive this automatic admission. This was source inspection, not an executed reproduction. (scripts/test-projects-run.mts:397, 9bf17b16a878)
  • Existing safety checks remain authoritative: The execution owner still requires CI-like execution, joined process groups, safe output, scheduler-owned caches, and no explicit serial override. The shared scheduler retains its resource-dependent cap of two and drains ordinary spans around exclusive plans; changed-mode admission does not install explicit-file no-tests failure semantics. (scripts/test-projects-run.mts:553, fd6430302c55)
  • Meaningful owner-boundary regression coverage: Two added matrix rows invoke runTestProjects with changed paths through the real planner and scheduler, observing peak overlap two or one with the serial override. Child execution is mocked; these are supplemental regression tests. The captured PR body reports baseline peak one, corrected peak two, 176 cases in 29.82 seconds, and a remote affected run using two plans with four workers each. (test/scripts/test-projects-build-admission.test.ts:657, fd6430302c55)
  • Related implementations remain open: The canonical report is [Bug]: Changed-test runs serialize independent test groups #162615. Its contributor discussion describes fix(test): route native changed runs through the CI affected-test owner #162671 as both a changed-selection policy replacement and an overlap fix. Live reads confirm that candidate remains open and unmerged with unknown mergeability, while this PR remains open, cleanly mergeable, and MEMBER-authored at the reviewed head. (65e5f7df932c)
  • Feature-history routing: Current-main history records Vincent Koc's scheduler work and repeated execution-owner maintenance by Peter Steinberger. GitHub commit metadata identifies their handles as vincentkoc and steipete. These support routing candidates, without claiming verified source-line introduction. (scripts/test-projects-run.mts, 706ffe7a79c0)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-01T12:51:44.905Z sha fd64303 :: needs maintainer review before merge. :: none

@shakkernerd shakkernerd self-assigned this Oct 1, 2026
@shakkernerd
shakkernerd merged commit afca8f9 into main Oct 1, 2026
118 checks passed
@shakkernerd
shakkernerd deleted the fix/affected-test-runtime branch October 1, 2026 13:35
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Fixed: concrete changed-test selections now use the existing bounded concurrent scheduler.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
Allow concrete changed-test selections to use the existing bounded concurrent scheduler while preserving serial and exclusive-suite safeguards.

Fixes openclaw#162615.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Changed-test runs serialize independent test groups

1 participant