Skip to content

test_runner: automatically wait for subtests to finish - #58800

Closed
LiviaMedeiros wants to merge 1 commit into
nodejs:mainfrom
LiviaMedeiros:rerevert-56664-auto-wait
Closed

test_runner: automatically wait for subtests to finish#58800
LiviaMedeiros wants to merge 1 commit into
nodejs:mainfrom
LiviaMedeiros:rerevert-56664-auto-wait

Conversation

@LiviaMedeiros

Copy link
Copy Markdown
Member

This commit updates the test runner to automatically wait for subtests to finish. This makes the experience more consistent with suites and removes the need to await anything.

Extracted from #56664 (aa3523e) which was reverted in #58282 due to breakage caused by other parts of it.

Authorship belongs to @cjihrig.

To minimize problems in userland, it would be highly preferable to ship this in the same release as #58282 (7a0c74b in particular), since aa3523e was already shipped in v24.0.0 and releasing this PR would keep everything as-is for current v24.x users.
This should not land on previous major release lines because #56664 was semver-majorPRs that contain breaking changes and should be released in the next major version. (although IMHO this particular change is backportable)

Cherry-pick was not 100% clean, there was a trivial conflict with #56765 at the end of lib/internal/test_runner/test.js diff, cc @pmarchini just in case.

cc @cjihrig@romainmenke @nodejs/test_runner

This commit updates the test runner to automatically wait for
subtests to finish. This makes the experience more consistent
with suites and removes the need to await anything.
@LiviaMedeirosLiviaMedeiros added dont-land-on-v20.x dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. labels Jun 23, 2025
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Jun 23, 2025
@nodejs-github-bot

This comment was marked as outdated.

@codecov

codecovBot commented Jun 23, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.08%. Comparing base (04cb572) to head (0767b79).
Report is 11 commits behind head on main.

Files with missing linesPatch %Lines
lib/internal/test_runner/harness.js92.85%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #58800 +/- ##
=======================================
Coverage 90.07% 90.08% =======================================
Files 640 640 Lines 188262 188286 +24 Branches 36912 36915 +3 =======================================
+ Hits 169580 169612 +32 + Misses 11399 11396 -3 + Partials 7283 7278 -5 
Files with missing linesCoverage Δ
lib/internal/test_runner/test.js97.34% <100.00%> (+0.02%)⬆️
lib/internal/test_runner/harness.js93.33% <92.85%> (+0.19%)⬆️

... and 37 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nodejs-github-bot

nodejs-github-bot commented Jun 23, 2025

Copy link
Copy Markdown
Collaborator

@LiviaMedeirosLiviaMedeiros added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 24, 2025
@jasnelljasnell added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 24, 2025
RafaelGSS pushed a commit that referenced this pull request Jun 24, 2025
This commit updates the test runner to automatically wait for
subtests to finish. This makes the experience more consistent
with suites and removes the need to await anything.
PR-URL: #58800
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
@RafaelGSS

Copy link
Copy Markdown
Member

Landed in dff081e

RafaelGSS pushed a commit that referenced this pull request Jun 24, 2025
This commit updates the test runner to automatically wait for
subtests to finish. This makes the experience more consistent
with suites and removes the need to await anything.
PR-URL: #58800
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
@panvapanva removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 29, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.dont-land-on-v22.xPRs that should not land on the v22.x-staging branch and should not be released in v22.x.needs-ciPRs that need a full CI run.test_runnerIssues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@LiviaMedeiros@nodejs-github-bot@RafaelGSS@jasnell@pmarchini@panva@cjihrig