Build gradle from source failed

I download a 2.14.1, 3.2.1 source files and am building Gradle. The build process is interrupted

For 3.2.1 (For 2.14.1 similarly)

./gradlew build -x test

:core:integTest

org.gradle.api.tasks.CopyErrorIntegrationTest > reportsUnreadableSourceDir FAILED
java.lang.AssertionError at CopyErrorIntegrationTest.groovy:87

org.gradle.api.tasks.ArchiveTaskPermissionsIntegrationTest > file and directory permissions are preserved for unpacked Zip archives FAILED
java.io.IOException at ArchiveTaskPermissionsIntegrationTest.groovy:103
Caused by: java.io.IOException at ArchiveTaskPermissionsIntegrationTest.groovy:103

772 tests completed, 2 failed, 16 skipped
:core:integTest FAILED
:cleanUpDaemons

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:core:integTest’.

There were failing tests. See the report at: file:///root/gradle-3.2/subprojects/core/build/reports/integTest/index.html

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 51 mins 43.972 secs

I try build gradle on CentOS 7.2 x64 and Ubuntu 14.04 x64.

java -version
java version “1.8.0_111”
Java™ SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot™ 64-Bit Server VM (build 25.111-b14, mixed mode)

How can I fix it?

Thanks.

Please provide the stack trace from the test report. Keep in mind that it is possible that tests are breaking as we continuously make changes to master. Another reason it might be breaking is that the tests are flaky though I am not seeing them fail in our CI infrastructure.