Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd warning for slow hostname lookups on OS X #3766
Conversation
lightbend-cla-validator
commented
Nov 24, 2017
|
Hi @eatkins, Thank you for your contribution! We really value the time you've taken to put this together. Before we proceed with reviewing this pull request, please sign the Lightbend Contributors License Agreement: |
|
I signed the Lightbend Contributors Licence Agreement. |
47ba411
to
2cb2aef
|
Given the only use of the hostname is to embed it into the JUnit results XML, what if we just avoid the whole pitfall and use "localhost"? |
|
@dwijnand My concern with changing the behavior is that users with multiple build agents may rely on the hostname field to determine on which machine their tests ran. An alternative approach would be to make the machine name configurable in the project settings and switch to using localhost by default. This would require existing users to update the machine name when they upgrade sbt though. |
|
@eatkins OK! Do you want to resolve the merge conflict, or shall I? |
|
Resolved. |
I spent a lot of time debugging why it took 5 seconds to run tests each time. It turns out that if the hostname is not set explicitly on os x, then getaddrinfo takes 5 seconds to try (and fail) to resolve the dns entry for the localhostname. This is easily fixed by setting the hostname, but it is not at all easy to figure out that a slow hostname lookup is the reason why tests are slow to start. I don't know if this is a common issue on other platforms, so only issue the warning on OS X.
eatkins commentedNov 24, 2017
I spent a lot of time debugging why it took 5 seconds to run tests each
time. It turns out that if the hostname is not set explicitly on os x,
then getaddrinfo takes 5 seconds to try (and fail) to resolve the dns
entry for the localhostname. This is easily fixed by setting the
hostname, but it is not at all easy to figure out that a slow hostname
lookup is the reason why tests are slow to start.
I don't know if this is a common issue on other platforms, so only issue
the warning on OS X.
Related to #1506
(See the guidelines for contributing, linked above)