From bc798f33e9224918e04c1cee465ad40b7c62b0d9 Mon Sep 17 00:00:00 2001 From: weiminyu Date: Tue, 15 Jan 2019 13:33:46 -0800 Subject: [PATCH] Automated g4 rollback of changelist 229414759. *** Reason for rollback *** Found more tests failing. *** Original change description *** Reenable Test Executor sharing in Gradle build Combining all tests in one suite and drop the forkEvery=1 directive. Issue was fixed by [] and [] TESTED=Run locally with maxParallelForks =1 and 5, and tested on travis with maxParallelForks=5 *** ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=229430425 --- gradle/core/build.gradle | 54 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/gradle/core/build.gradle b/gradle/core/build.gradle index 3ab9df3ef..a7ffd3e60 100644 --- a/gradle/core/build.gradle +++ b/gradle/core/build.gradle @@ -6,6 +6,30 @@ plugins { // used for easy inspection. def generatedDir = "${project.buildDir}/generated/source/custom/main" +// Tests that conflict with (mostly unidentified) members of the main test +// suite. It is unclear if they are offenders (i.e., those that pollute global +// state) or victims. +// TODO(weiminyu): identify cause and fix offending tests. +def outcastTestPatterns = [ + "google/registry/batch/DeleteContactsAndHostsActionTest.*", + "google/registry/batch/RefreshDnsOnHostRenameActionTest.*", + "google/registry/flows/CheckApiActionTest.*", + "google/registry/flows/EppLifecycleHostTest.*", + "google/registry/flows/domain/DomainCreateFlowTest.*", + "google/registry/flows/domain/DomainUpdateFlowTest.*", + "google/registry/tools/CreateDomainCommandTest.*", + "google/registry/tools/server/CreatePremiumListActionTest.*", + // Conflicts with WhoisActionTest + "google/registry/whois/WhoisHttpActionTest.*", +] + +// Tests that conflict with members of both the main test suite and the +// outcast suite. +// TODO(weiminyu): identify cause and fix offending tests. +def fragileTestPatterns = [ + "google/registry/cron/TldFanoutActionTest.*" +] + sourceSets { main { java { @@ -404,14 +428,42 @@ artifacts { testRuntime testJar } -test { +task fragileTest(type: Test) { // Common exclude pattern. See README in parent directory for explanation. exclude "**/*TestCase.*", "**/*TestSuite.*" + include fragileTestPatterns + + // Run every test class in a freshly started process. + forkEvery 1 + + // Uncomment to see test outputs in stdout. + //testLogging.showStandardStreams = true +} + +task outcastTest(type: Test) { + // Common exclude pattern. See README in parent directory for explanation. + exclude "**/*TestCase.*", "**/*TestSuite.*" + include outcastTestPatterns // Sets the maximum number of test executors that may exist at the same time. maxParallelForks 5 } +test { + // Common exclude pattern. See README in parent directory for explanation. + exclude "**/*TestCase.*", "**/*TestSuite.*" + exclude fragileTestPatterns + exclude outcastTestPatterns + + // Run every test class in its own process. + // TODO: Figure out why we need to do this, fix it and then stop doing it. + // This setting makes the build take 35 minutes, without it it takes about 10. + forkEvery 1 + + // Sets the maximum number of test executors that may exist at the same time. + maxParallelForks 5 +}.dependsOn(fragileTest, outcastTest) + task nomulus(type: Jar) { manifest { attributes 'Main-Class': 'google.registry.tools.RegistryTool'