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: Avoid freeport() collisions in io tests #3509

Merged
merged 1 commit into from May 12, 2024

Conversation

wolfgangwalther
Copy link
Member

It's very unlikely, but it can (and did) happen that both the server and admin ports have the same number returned from freeport(). This then leads to a situation where PostgREST will accept the same port in both cases, because the host "localhost" will allow binding to ipv4 or ipv6 respectively. This will make the IO tests fail.

This change makes sure that the admin port will never be the same as the server port and thus avoids this problem.

It's very unlikely, but it can (and did) happen that both the server and
admin ports have the same number returned from freeport(). This then
leads to a situation where PostgREST will accept the same port in both
cases, because the host "localhost" will allow binding to ipv4 or ipv6
respectively. This will make the IO tests fail.

This change makes sure that the admin port will never be the same as the
server port and thus avoids this problem.
@wolfgangwalther wolfgangwalther merged commit 71885bd into PostgREST:main May 12, 2024
15 checks passed
@wolfgangwalther wolfgangwalther deleted the freeport-collision branch May 12, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants