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

Fix tests on MacOS #266

Merged
merged 2 commits into from
Jan 7, 2025
Merged

Conversation

TravisWhitaker
Copy link
Contributor

Previously the Issue238 tests failed on MacOS with "connection refused" in the client, but suspiciously all other tests passed. It took me longer than I'd like to admit to figure out why this was the case, but it's because these tests don't use the shared testClientServer driver that all of the other ones do. Instead, their own testWith passes Nothing as the bind addr, and on MacOS that winds up making an IPv6 socket and binding it to ::. On Linux, one of two things prevents this from being a problem depending on the setup:

  • An IPv4 socket is created by default.
  • The IPV6_V6ONLY option is 0 by default (the manpage says that this can vary at runtime by some unspecified mechanism and programs must check /proc/sys/net/ipv6/bindv6only if they want to know the default value)

Providing an IPv4 bind address fixes this issue on MacOS.

@TravisWhitaker
Copy link
Contributor Author

Same thing in the tutorial servers, except binding the IPv4 wildcard instead of localhost as tutorial users might run the servers and clients on different machines.

@edsko
Copy link
Collaborator

edsko commented Jan 7, 2025

Ah. Yes, we already fixed this in some other tests, sorry that we missed a few! Thanks for the PR :)

@edsko edsko merged commit da3e531 into well-typed:main Jan 7, 2025
6 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.

2 participants