Skip to content
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

test(runStaticServer): Improve testing failure when port is in use #396

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

gadenbuie
Copy link
Member

@gadenbuie gadenbuie commented Feb 2, 2024

Fixes #393

This PR updates a test for runStaticServer() that ensures it throws an error if the user requests a port that is already in use (as opposed to finding an unsued port, which is what happens if the user doesn't have a port preference).

To test this, we previously found an unsafe and used port, but in certain environments all of the unsafe ports are available (e.g. in freebsd jail). Rather than using the unsafe ports list, this test now starts up a static server and then tries to start a second static server using the same port.

Does this change warrant a NEWS bullet?

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this pull request Feb 3, 2024
While here, apply upstream patch to fix tests when all of the unsafe
ports are available (e.g. poudriere jail).

See also: rstudio/httpuv#396
Copy link
Collaborator

@wch wch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. A NEWS bullet would be helpful.

@gadenbuie gadenbuie merged commit ac79a51 into main Feb 8, 2024
23 checks passed
@gadenbuie gadenbuie deleted the tests/fix-all-ports-available branch February 8, 2024 23:24
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.

testunit fails: "runStaticServer() throws an error if the requested port is used --"
2 participants