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

Don't assume that 127.0.0.[2-255] aren't in use. #652

Merged
merged 1 commit into from
Oct 17, 2023
Merged

Conversation

ewollesen
Copy link
Contributor

A pair of tests were testing error paths for non-responsive hosts. To do so, they were attempting to connect to 127.0.0.2 and 127.0.0.3. However, some hosts are configured to respond to 127.0.0.0/8 as localhost, and with such a configuration, these tests could fail.

One alternative is to configure mongodb to bind specifically to 127.0.0.1. Another would be a test helper that tests the expected IP to make sure nothing responds before running the test, possibly skipping it if something responds (or trying another address?) But this solution seems like the simplest, easiest change to make, that covers the most possible configurations.

A pair of tests were testing error paths for non-responsive hosts. To do so,
they were attempting to connect to 127.0.0.2 and 127.0.0.3. However, some
hosts are configured to respond to 127.0.0.0/8 as localhost, and with such a
configuration, these tests could fail.

One alternative is to configure mongodb to bind specifically to
127.0.0.1. Another would be a test helper that tests the expected IP to make
sure nothing responds before running the test, possibly skipping it if
something responds (or trying another address?) But this solution seems like
the simplest, easiest change to make, that covers the most possible
configurations.
@Roukoswarf Roukoswarf merged commit 9d11f21 into master Oct 17, 2023
3 checks passed
@Roukoswarf Roukoswarf deleted the eric/localhost branch October 17, 2023 17:46
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.

3 participants