Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 980
Johan Avatar asked Sep 26 '16 10:09

Johan


1 Answers

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.

like image 197
Rich Riley Avatar answered Oct 10 '22 15:10

Rich Riley