Skip to content

test_runner: automatically wait for subtests to finish #58800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

LiviaMedeiros
Copy link
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-major PRs 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.
@LiviaMedeiros LiviaMedeiros added dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in 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
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-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.

Copy link

codecov bot commented Jun 23, 2025

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 lines Patch % Lines
lib/internal/test_runner/harness.js 92.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 lines Coverage Δ
lib/internal/test_runner/test.js 97.34% <100.00%> (+0.02%) ⬆️
lib/internal/test_runner/harness.js 93.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
Copy link
Collaborator

nodejs-github-bot commented Jun 23, 2025

@LiviaMedeiros LiviaMedeiros added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 24, 2025
@jasnell jasnell 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 <[email protected]>
Reviewed-By: Pietro Marchini <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
@RafaelGSS
Copy link
Member

Landed in dff081e

@RafaelGSS RafaelGSS closed this 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 <[email protected]>
Reviewed-By: Pietro Marchini <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in 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. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants