From 4b4be38d96051e90338f2dd2cd8ee4584a9aaac0 Mon Sep 17 00:00:00 2001 From: Lai Jiang Date: Mon, 4 May 2020 11:38:54 -0400 Subject: [PATCH] Fix test failures on certain machines (#571) On certain machines (one of mine) the outcastTest consistently fails due to the following error: java.lang.NoClassDefFoundError: Could not initialize class google.registry.persistence.transaction.JpaTestRules$JpaIntegrationTestRule If I reduce maxparallelForks to 3 it consistently passes. This issue was mentioned here: https://discuss.gradle.org/t/junit-test-fails-with-noclassdeffounderror-only-when-maxparallelforks-1/6047 But this post was 8 years old and no solution was identified. --- core/build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/build.gradle b/core/build.gradle index ba95501ed..cc2f7bc29 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -709,7 +709,10 @@ task outcastTest(type: FilteringTest) { tests = outcastTestPatterns // Sets the maximum number of test executors that may exist at the same time. - maxParallelForks 5 + // Note that this number appears to contribute to NoClassDefFoundError + // exceptions on certain machines and distros. The root cause is unclear. + // Try reducing this number if you experience similar problems. + maxParallelForks 3 } // Whitebox test verifying that RegistryTool can be instantiated. Note the