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

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.05%. Comparing base (0992d28) to head (c98281c).
Report is 44 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #59042      +/-   ##
==========================================
- Coverage   90.06%   90.05%   -0.02%     
==========================================
  Files         641      648       +7     
  Lines      188846   190967    +2121     
  Branches    37049    37429     +380     
==========================================
+ Hits       170087   171966    +1879     
- Misses      11476    11620     +144     
- Partials     7283     7381      +98     

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

@dario-piotrowicz dario-piotrowicz added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Jul 19, 2025
@dario-piotrowicz
Copy link
Member Author

thanks @aduh95 🙏

@dario-piotrowicz dario-piotrowicz added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 20, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 20, 2025
@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor

aduh95 commented Jul 20, 2025

@dario-piotrowicz don't forget to add author ready PRs that have at least one approval, no pending requests for changes, and a CI started.

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 20, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@dario-piotrowicz
Copy link
Member Author

@dario-piotrowicz don't forget to add author ready

Sorry, I have forgotten about the label lately, I'll be more careful, thanks 🙏

@dario-piotrowicz dario-piotrowicz added the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 20, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jul 20, 2025
@nodejs-github-bot nodejs-github-bot merged commit 29626f8 into nodejs:main Jul 20, 2025
67 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 29626f8

@dario-piotrowicz dario-piotrowicz deleted the dario/default-startCLI-to-random-port branch July 20, 2025 18:00
aduh95 pushed a commit that referenced this pull request Jul 21, 2025
update the `startCLI` debugging testing utility to set by default
the port to use to `0` (i.e. a random port)

PR-URL: #59042
Reviewed-By: Antoine du Hamel <[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-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. 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.

3 participants