[PR #7971] [MERGED] chore(regressions): run Node regression files concurrently #8031

Closed
opened 2026-10-24 04:09:48 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7971
Author: @Promansis
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/21/2026
Merged by: @Promansis

Base: staging ← Head: chore/7970-concurrent-regressions


📝 Commits (6)

  • d550995 chore: start concurrent Node regression runner for #7970
  • ff557df chore(regressions): run Node regression files in a bounded parallel pool (#7970)
  • 6d80c64 fix(regressions): keep one-file runs serial and tidy pool edge cases (#7970)
  • 4be3f26 fix(regressions): stop running children on a runner error; dev-mcp reads latest attempts (#7970)
  • dade4b1 Merge branch 'staging' into chore/7970-concurrent-regressions
  • 3a7a2c9 Merge branch 'staging' into chore/7970-concurrent-regressions

📊 Changes

4 files changed (+112 additions, -39 deletions)

View changed files

📝 CONTRIBUTING.md (+1 -1)
📝 scripts/regressions/regression-timeout-policy.regression.mjs (+8 -0)
📝 scripts/run-regressions.mjs (+81 -36)
📝 tools/dev-mcp/lib/engine.mjs (+22 -2)

📄 Description

Linked issue

Closes #7970

Why this change

  • scripts/run-regressions.mjs ran every Node regression file one after another. On the hosted runner (4 vCPU) the complete-node-regressions job took 34.8 min for 952 files, against a 45 min timeout-minutes, and the suite keeps growing. This PR runs the files side by side.

Summary

 main()
-  for file in selected: runRegression(file)            # one child at a time
+  workers = min(--concurrency | REGRESSION_CONCURRENCY | os.availableParallelism(), files)
+  if workers > 1: start the known slow files (longer timeout) first
+  pool of `workers` running runRegression(file, buffered)   # output printed as one block with its result line
+  files that missed in the pool (<= 20): run again one at a time; that run decides
   print per-file lines, "Regression not passed" lines, summary, exit code

What changed

  • pnpm regression runs the Node regression files in parallel, one per CPU core by default. Set the count with --concurrency <n> or REGRESSION_CONCURRENCY. --concurrency 1, and any run that selects only one file, keep the old serial behaviour with live output.
  • When files run in parallel, each file's output prints as one block together with its result line.
  • A file that fails or times out while running beside others gets one more run on its own after the rest, and that run decides its result. The per-file timeouts and a few wall-clock budgets in the tests were set for one file at a time. If more than 20 files miss, nothing is retried and the runner says so.
  • Ctrl+C, SIGTERM, a per-file timeout and a runner error stop every running child.
  • dev-mcp's run_regressions now reads the runner's final "Regression not passed" lines. If the run stops before its summary, it lists each file whose latest attempt missed.
  • No file needed a serial-only list. The search found no fixed ports (servers use listen(0)), no shared fixed temp paths and no process.chdir, and full parallel runs left the repository unchanged.

Evidence

Local runs on a shared 12-core development machine (other sessions were running at the same time):

Run Result Wall time
--concurrency 1 (serial path, 6d80c64a5) 956/956 passed 1812 s (30.2 min)
--concurrency 4 (ubuntu-latest width, ff557df62) 956/956 passed, no misses 576 s (9.6 min)
pnpm regression, default 12 workers (ff557df62) 956/956 passed, no misses 324 s (5.4 min), including build:shared
  • Before: hosted complete-node-regressions: 34.8 min, serial (Oct 21 staging run).
    After: hosted complete-node-regressions on this PR (merge of 4be3f266b with staging, dade4b1b1, 4 workers): 956/956 passed, no misses or retries. The test step took 10 min 38 s and the job 11 min 12 s, about 3.3 times faster, but not yet under 10 min.
  • In an early 12-wide run on the same machine while it was heavily loaded (load average about 29), before the slow-first order and the retry were added, 21 files missed. 19 hit the 30 s timeout and 2 hit wall-clock budgets (1 s and 7.5 s). The combat-director file started at position 849 and was the last to finish. All of these passed when run alone, which is why the retry and the slow-first order were added.
  • --concurrency 1 output matches the old runner line for line on --filter scripts/regressions/prompt (881 lines; only timestamps, process ids and durations differ).
  • Probe files (deleted afterwards) showed:
    • Grouped output.
    • A pool miss that passes when retried alone.
    • A one-file run that fails is not retried.
    • SIGINT force-kills three children that ignore SIGTERM (exit 130).
    • A runner error (mkdtempSync failing) stops a hanging child at once (exit 1 after 0.6 s).
    • dev-mcp's fallback when the run stops before its summary.
  • pnpm check passed at ff557df62. The later commits only touch scripts/run-regressions.mjs and tools/dev-mcp/lib/engine.mjs, which are outside its lint and format scope.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify the Regression Checks job on this PR finishes under 10 min.
  • Manually verify a local pnpm regression prints each file's output as one block and ends with the summary line.
  • Manually verify node scripts/run-regressions.mjs --concurrency 1 --filter prompt streams output live, as before.
  • Manually verify Ctrl+C during pnpm regression leaves no tsx regression processes running.

Merge Danger

Door: two-way. This only changes the test runner and dev tooling. Reverting the commits restores the serial runner.

Blast Radius: CI time. A test that only passes when run alone is retried alone, so it still passes, but its first attempt shows as FAILED or TIMEOUT in the log.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

CONTRIBUTING.md's regression-runner paragraph is updated. Nothing under docs/ changed.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Regression checks now run in parallel by default, improving execution speed.
    • Concurrency can be configured, with output grouped for easier review.
    • Failed or timed-out checks are retried individually when practical.
  • Bug Fixes

    • Invalid concurrency values are now rejected with a clear error.
    • Regression results more accurately reflect the latest attempt and provide clearer failure identification.
  • Documentation

    • Updated regression testing guidance to describe parallel execution, concurrency settings, grouped output, and retry behavior.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7971 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/21/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `chore/7970-concurrent-regressions` --- ### 📝 Commits (6) - [`d550995`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d550995f62baf32eacab607c30f3f75fc5599063) chore: start concurrent Node regression runner for #7970 - [`ff557df`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ff557df6268d70cc6fabd1c00cf1de33dcb40466) chore(regressions): run Node regression files in a bounded parallel pool (#7970) - [`6d80c64`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6d80c64a50eb5cae25b29711e771ba97f38f36c2) fix(regressions): keep one-file runs serial and tidy pool edge cases (#7970) - [`4be3f26`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4be3f266b3fd66703ab9124cf9ede82e2501338e) fix(regressions): stop running children on a runner error; dev-mcp reads latest attempts (#7970) - [`dade4b1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dade4b1b1f7c1457024a4d0f7bf08f95db961c3f) Merge branch 'staging' into chore/7970-concurrent-regressions - [`3a7a2c9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3a7a2c99d50afdb0510d03adf157fdb58f8bd5d0) Merge branch 'staging' into chore/7970-concurrent-regressions ### 📊 Changes **4 files changed** (+112 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTING.md` (+1 -1) 📝 `scripts/regressions/regression-timeout-policy.regression.mjs` (+8 -0) 📝 `scripts/run-regressions.mjs` (+81 -36) 📝 `tools/dev-mcp/lib/engine.mjs` (+22 -2) </details> ### 📄 Description ## Linked issue Closes #7970 ## Why this change - `scripts/run-regressions.mjs` ran every Node regression file one after another. On the hosted runner (4 vCPU) the `complete-node-regressions` job took 34.8 min for 952 files, against a 45 min `timeout-minutes`, and the suite keeps growing. This PR runs the files side by side. ## Summary ```diff main() - for file in selected: runRegression(file) # one child at a time + workers = min(--concurrency | REGRESSION_CONCURRENCY | os.availableParallelism(), files) + if workers > 1: start the known slow files (longer timeout) first + pool of `workers` running runRegression(file, buffered) # output printed as one block with its result line + files that missed in the pool (<= 20): run again one at a time; that run decides print per-file lines, "Regression not passed" lines, summary, exit code ``` ## What changed - `pnpm regression` runs the Node regression files in parallel, one per CPU core by default. Set the count with `--concurrency <n>` or `REGRESSION_CONCURRENCY`. `--concurrency 1`, and any run that selects only one file, keep the old serial behaviour with live output. - When files run in parallel, each file's output prints as one block together with its result line. - A file that fails or times out while running beside others gets one more run on its own after the rest, and that run decides its result. The per-file timeouts and a few wall-clock budgets in the tests were set for one file at a time. If more than 20 files miss, nothing is retried and the runner says so. - Ctrl+C, SIGTERM, a per-file timeout and a runner error stop every running child. - dev-mcp's `run_regressions` now reads the runner's final "Regression not passed" lines. If the run stops before its summary, it lists each file whose latest attempt missed. - No file needed a serial-only list. The search found no fixed ports (servers use `listen(0)`), no shared fixed temp paths and no `process.chdir`, and full parallel runs left the repository unchanged. ## Evidence Local runs on a shared 12-core development machine (other sessions were running at the same time): | Run | Result | Wall time | | --- | --- | --- | | `--concurrency 1` (serial path, 6d80c64a5) | 956/956 passed | 1812 s (30.2 min) | | `--concurrency 4` (ubuntu-latest width, ff557df62) | 956/956 passed, no misses | 576 s (9.6 min) | | `pnpm regression`, default 12 workers (ff557df62) | 956/956 passed, no misses | 324 s (5.4 min), including `build:shared` | - **Before:** hosted `complete-node-regressions`: 34.8 min, serial (Oct 21 staging run). **After:** hosted `complete-node-regressions` on this PR (merge of 4be3f266b with staging, dade4b1b1, 4 workers): 956/956 passed, no misses or retries. The test step took 10 min 38 s and the job 11 min 12 s, about 3.3 times faster, but not yet under 10 min. - In an early 12-wide run on the same machine while it was heavily loaded (load average about 29), before the slow-first order and the retry were added, 21 files missed. 19 hit the 30 s timeout and 2 hit wall-clock budgets (1 s and 7.5 s). The combat-director file started at position 849 and was the last to finish. All of these passed when run alone, which is why the retry and the slow-first order were added. - `--concurrency 1` output matches the old runner line for line on `--filter scripts/regressions/prompt` (881 lines; only timestamps, process ids and durations differ). - Probe files (deleted afterwards) showed: - Grouped output. - A pool miss that passes when retried alone. - A one-file run that fails is not retried. - SIGINT force-kills three children that ignore SIGTERM (exit 130). - A runner error (`mkdtempSync` failing) stops a hanging child at once (exit 1 after 0.6 s). - dev-mcp's fallback when the run stops before its summary. - `pnpm check` passed at ff557df62. The later commits only touch `scripts/run-regressions.mjs` and `tools/dev-mcp/lib/engine.mjs`, which are outside its lint and format scope. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - [ ] Manually verify the Regression Checks job on this PR finishes under 10 min. - [ ] Manually verify a local `pnpm regression` prints each file's output as one block and ends with the summary line. - [ ] Manually verify `node scripts/run-regressions.mjs --concurrency 1 --filter prompt` streams output live, as before. - [ ] Manually verify Ctrl+C during `pnpm regression` leaves no `tsx` regression processes running. ## Merge Danger **Door:** two-way. This only changes the test runner and dev tooling. Reverting the commits restores the serial runner. **Blast Radius:** CI time. A test that only passes when run alone is retried alone, so it still passes, but its first attempt shows as FAILED or TIMEOUT in the log. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) CONTRIBUTING.md's regression-runner paragraph is updated. Nothing under `docs/` changed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit - **New Features** - Regression checks now run in parallel by default, improving execution speed. - Concurrency can be configured, with output grouped for easier review. - Failed or timed-out checks are retried individually when practical. - **Bug Fixes** - Invalid concurrency values are now rejected with a clear error. - Regression results more accurately reflect the latest attempt and provide clearer failure identification. - **Documentation** - Updated regression testing guidance to describe parallel execution, concurrency settings, grouped output, and retry behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:09:48 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8031
No description provided.