Maven with Surefire (TestNG) is slow after update to MacOS Sierra

喜夏-厌秋 提交于 2019-12-20 09:45:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!