问题
Before the update my MacBook Pro to MacOs Sierra, the command:
mvn clean install -U
took about 40 sec to run, with several hundreds of tests in several maven sub-modules.
After the update to MacOS Sierra, with no changes to the code, the same command takes over 12 minutes. It looks to me that the when the Surefire plugin is going to print the result of the current module, it hangs for 2-3 minutes before continuing. The speed of the test-execution up to this point is as fast as before the update to MacOS Sierra.
Example of a TestNG result printout from on of the modules:
Tests run: 101, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 167.854 sec
Results :
Tests run: 101, Failures: 0, Errors: 0, Skipped: 0
Does anyone know the reasons behind this?
回答1:
I've had this exact problem (and spent the last 6 hours trying to solve it). My problem was that my HostName wasn't set.
Check that:
sudo scutil --get LocalHostName
Matches:
sudo scutil --get HostName
And if they don't, use:
sudo scutil --set HostName [YOUR_HOST_NAME]
To fix it.
来源:https://stackoverflow.com/questions/39700882/maven-with-surefire-testng-is-slow-after-update-to-macos-sierra