Skip to content

refactor: use port helpers from appium/support instead of portscanner - #213

Merged
mykola-mokhnach merged 1 commit into
appium:masterfrom
mykola-mokhnach:refactor/use-support-net-ports
Nov 13, 2026
Merged

mykola-mokhnach merged 1 commit into
appium:masterfrom
mykola-mokhnach:refactor/use-support-net-ports

Conversation

@mykola-mokhnach

Copy link
Copy Markdown
Contributor

Replace portscanner with net.getFreePort/net.checkPortStatus from appium/support, and drop portscanner and @types/portscanner from the dependencies.

  • findAPortNotInUse(start, end[, host]) -> getFreePort({port: [start, end], host}); it throws NoFreePortError if the range is exhausted, same as before for the callers here
  • checkPortStatus(port, host) -> checkPortStatus(port, {host}); unlike portscanner, it throws on unexpected socket errors rather than reporting closed

Replace `portscanner` with `net.getFreePort`/`net.checkPortStatus` from `appium/support`, and drop `portscanner` and `@types/portscanner` from the dependencies.

- `findAPortNotInUse(start, end[, host])` -> `getFreePort({port: [start, end], host})`; it throws `NoFreePortError` if the range is exhausted, same as before for the callers here
- `checkPortStatus(port, host)` -> `checkPortStatus(port, {host})`; unlike `portscanner`, it throws on unexpected socket errors rather than reporting `closed`
@mykola-mokhnach
mykola-mokhnach merged commit 23d99d9 into appium:master Nov 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant