From b2363db3d6848c80af4b6011023c4b27a0d067d2 Mon Sep 17 00:00:00 2001 From: Eric Meisel Date: Fri, 12 Feb 2021 15:20:35 -0600 Subject: [PATCH] Fix SBT Warn on slow HostName Turns out the snippet provided in the warning was incorrect and did not resolve the issue properly. Adding `.local` to the end of the HostName will resolve the slowness. See the 2nd answer here: https://apple.stackexchange.com/questions/175320/why-is-my-hostname-resolution-taking-so-long --- testing/src/main/scala/sbt/JUnitXmlTestsListener.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala b/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala index d8e0bfa2b..1a3cf42e9 100644 --- a/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala +++ b/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala @@ -51,7 +51,7 @@ class JUnitXmlTestsListener(val outputDir: String, legacyTestReport: Boolean, lo logger.warn( s"Getting the hostname $name was slow (${elapsed / 1.0e6} ms). " + "This is likely because the computer's hostname is not set. You can set the " + - "hostname with the command: scutil --set HostName $(scutil --get LocalHostName)." + """hostname with the command: scutil --set HostName "$(scutil --get LocalHostName).local".""" ) } name