test: use spawnSync helpers in cpu-prof tests - #65694
Open
DevJunz wants to merge 1 commit into
Open
Conversation
The cpu-prof tests hand-rolled a partial version of what test/common/child_process already provides: log the child's stderr when the status is non-zero, then assert the status. That manual version never shows stdout, the signal, or the command that ran, so a CI failure gives less information than the helper would. Replace those blocks with spawnSyncAndExitWithoutError(). Every existing expectation is preserved -- status 0 is still required, and signal null is now checked as well, matching the helper defaults. Only success-path blocks whose assertions map one-to-one onto the helper defaults are converted. Refs: nodejs#65351 Refs: nodejs#65552 Assisted-by: claude:opus-5 Signed-off-by: Junhwan Choi <devjunsday@gmail.com>
DevJunz
marked this pull request as draft
September 1, 2026 06:49
DevJunz
marked this pull request as ready for review
September 1, 2026 07:12
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65694 +/- ##
=======================================
Coverage 90.06% 90.07%
=======================================
Files 754 754
Lines 256395 256395
Branches 48500 48499 -1
=======================================
+ Hits 230922 230941 +19
- Misses 16574 16580 +6
+ Partials 8899 8874 -25 🚀 New features to boost your workflow:
|
lpinca
approved these changes
Sep 1, 2026
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the manual
spawnSync()status checks in the eight--cpu-proftests withspawnSyncAndExitWithoutError()fromtest/common/child_process, following the same approach as #65552.These tests logged stderr when the status was non-zero and then asserted the status, so a CI failure never showed stdout, the signal, or the command that ran. The helper reports all of them. Status 0 is still required, and signal null is now checked as well, matching the helper defaults.
Only success-path blocks whose assertions map one-to-one onto the helper defaults are converted.
Refs: #65552