Failed openmrs-core SecurityTest

If I pull the latest openmrs-core master branch and run mvn clean install the following test fails:

Tests in error: SecurityTest.encrypt_shouldEncryptShortAndLongText:190 » API No encryption sec…

-------------------------------------------------------------------------------
Test set: org.openmrs.util.SecurityTest
-------------------------------------------------------------------------------
Tests run: 7, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.198 sec <<< FAILURE! - in org.openmrs.util.SecurityTest
encrypt_shouldEncryptShortAndLongText(org.openmrs.util.SecurityTest)  Time elapsed: 0.006 sec  <<< ERROR!
org.openmrs.api.APIException: No encryption secret key found
	at org.openmrs.util.Security.getSavedSecretKey(Security.java:335)
	at org.openmrs.util.Security.encrypt(Security.java:244)
	at org.openmrs.util.SecurityTest.encrypt_shouldEncryptShortAndLongText(SecurityTest.java:190)

Has anyone seen this test failure? (I am running on Mac OS). How do I fix it? Thanks.

Which version of Java do you have?

Java 8:

java version “1.8.0_151”

Java™ SE Runtime Environment (build 1.8.0_151-b12)

Java HotSpot™ 64-Bit Server VM (build 25.151-b12, mixed mode)

What does this command return? mvn -v

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=256m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T03:58:13-04:00)
Maven home: /Users/cioan/install/bin/apache-maven-3.5.2
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.6", arch: "x86_64", family: "mac"

Do you still get this error when you run this one test from your IDE?

No, it is working fine from within intelliJ.

How about if you run this one test class from command line?

It works fine:

mvn test -DfailIfNoTests=false -Dtest=SecurityTest

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
objc[18129]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/bin/java (0x1056704c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x1056f44e0). One of the two will be used. Which one is undefined.
Running org.openmrs.util.SecurityTest
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.498 sec - in org.openmrs.util.SecurityTest

Results :

Tests run: 7, Failures: 0, Errors: 0, Skipped: 0