Skip to content

test: update startCLI to set --port=0 by default #59042

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dario-piotrowicz
Copy link
Member

update the startCLI debugging testing utility to set by default the port to use to 0 (i.e. a random port)


To me this sounds like the most appropriate default behavior since:

  • setting the port to 0 is the general correct behavior and most startCLI calls currently indeed do that
  • generally forgetting to set the port to 0 would most likely lead to issues down the line that would however not be immediately apparent such as flakiness (i.e. it's easy to forget and doing so can cause issues later on)
    (for example see: test: add missing port=0 arg in test-debugger-extract-function-name #58977)
  • when a specific port should be used that's clear based on the test and the caller would in any case need to already factor that in in the startCLI call, if they didn't the test would always fail (instead of generally passing but with potential flakes)

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jul 12, 2025
@dario-piotrowicz dario-piotrowicz force-pushed the dario/default-startCLI-to-random-port branch 2 times, most recently from 081472b to 80edf69 Compare July 13, 2025 00:36
update the `startCLI` debugging testing utility to set by default
the port to use to `0` (i.e. a random port)
@dario-piotrowicz dario-piotrowicz force-pushed the dario/default-startCLI-to-random-port branch from 80edf69 to bee555a Compare July 13, 2025 01:09
Copy link

codecov bot commented Jul 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.06%. Comparing base (0992d28) to head (bee555a).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59042      +/-   ##
==========================================
- Coverage   90.06%   90.06%   -0.01%     
==========================================
  Files         641      645       +4     
  Lines      188846   189130     +284     
  Branches    37049    37099      +50     
==========================================
+ Hits       170087   170342     +255     
+ Misses      11476    11465      -11     
- Partials     7283     7323      +40     

see 48 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants