Skip to content

Commit

Permalink
Revert "Migrate rolling upgrade tests to new junit format" (elastic#9…
Browse files Browse the repository at this point in the history
…9750)

Reverts elastic#99572 and elastic#99733

The new tests are unstable, and don't work on CI. This re-opens
elastic#97200
  • Loading branch information
thecoop authored Sep 21, 2023
1 parent 61abe14 commit 06f09d8
Show file tree
Hide file tree
Showing 28 changed files with 636 additions and 897 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
map.put(LegacyRestTestBasePlugin.class, ":qa:remote-clusters");
map.put(LegacyRestTestBasePlugin.class, ":qa:repository-multi-version");
map.put(LegacyRestTestBasePlugin.class, ":qa:rolling-upgrade");
map.put(LegacyRestTestBasePlugin.class, ":qa:rolling-upgrade-legacy");
map.put(LegacyRestTestBasePlugin.class, ":qa:smoke-test-http");
map.put(LegacyRestTestBasePlugin.class, ":qa:smoke-test-ingest-disabled");
map.put(LegacyRestTestBasePlugin.class, ":qa:smoke-test-ingest-with-all-dependencies");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<!-- Intentionally have multi line string for a bulk request, otherwise this needs to fallback to string concatenation -->
<suppress files="modules[/\\]data-streams[/\\]src[/\\]javaRestTest[/\\]java[/\\]org[/\\]elasticsearch[/\\]datastreams[/\\]TsdbDataStreamRestIT.java" checks="LineLength" />
<suppress files="qa[/\\]rolling-upgrade[/\\]src[/\\]javaRestTest[/\\]java[/\\]org[/\\]elasticsearch[/\\]upgrades[/\\]TsdbIT.java" checks="LineLength" />
<suppress files="qa[/\\]rolling-upgrade[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]upgrades[/\\]TsdbIT.java" checks="LineLength" />

<!-- Gradle requires inputs to be seriablizable -->
<suppress files="build-tools-internal[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]gradle[/\\]internal[/\\]precommit[/\\]TestingConventionRule.java" checks="RegexpSinglelineJava" />
Expand Down
5 changes: 0 additions & 5 deletions qa/full-cluster-restart/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ apply plugin: 'elasticsearch.internal-java-rest-test'
apply plugin: 'elasticsearch.internal-test-artifact'
apply plugin: 'elasticsearch.bwc-test'

test {
// CI doesn't like it when there's multiple clusters running at once
maxParallelForks = 1
}

BuildParams.bwcVersions.withIndexCompatible { bwcVersion, baseName ->
tasks.register(bwcTaskName(bwcVersion), StandaloneRestIntegTestTask) {
usesBwcDistribution(bwcVersion)
Expand Down
143 changes: 0 additions & 143 deletions qa/rolling-upgrade-legacy/build.gradle

This file was deleted.

137 changes: 121 additions & 16 deletions qa/rolling-upgrade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,135 @@
* Side Public License, v 1.
*/


import org.elasticsearch.gradle.Version
import org.elasticsearch.gradle.internal.BwcVersions
import org.elasticsearch.gradle.internal.info.BuildParams
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask

apply plugin: 'elasticsearch.internal-testclusters'
apply plugin: 'elasticsearch.internal-java-rest-test'
apply plugin: 'elasticsearch.internal-test-artifact-base'
apply plugin: 'elasticsearch.standalone-rest-test'
apply plugin: 'elasticsearch.bwc-test'
apply plugin: 'elasticsearch.rest-resources'

testArtifacts {
registerTestArtifactFromSourceSet(sourceSets.javaRestTest)
}
BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
/*
* The goal here is to:
* <ul>
* <li>start three nodes on the old version
* <li>run tests with systemProperty 'tests.rest.suite', 'old_cluster'
* <li>upgrade one node
* <li>run tests with systemProperty 'tests.rest.suite', 'mixed_cluster'
* <li>upgrade one more node
* <li>run tests with systemProperty 'tests.rest.suite', 'mixed_cluster' again
* <li>updgrade the last node
* <li>run tests with systemProperty 'tests.rest.suite', 'upgraded_cluster'
* </ul>
*/

test {
// CI doesn't like it when there's multiple clusters running at once
maxParallelForks = 1
}
def baseCluster = testClusters.register(baseName) {
versions = [bwcVersion.toString(), project.version]
numberOfNodes = 3

BuildParams.bwcVersions.withWireCompatible { bwcVersion, baseName ->
tasks.register(bwcTaskName(bwcVersion), StandaloneRestIntegTestTask) {
usesBwcDistribution(bwcVersion)
systemProperty("tests.old_cluster_version", bwcVersion)
setting 'repositories.url.allowed_urls', 'http://snapshot.test*'
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
setting 'xpack.security.enabled', 'false'
setting 'logger.org.elasticsearch.cluster.service.MasterService', 'TRACE'
setting 'logger.org.elasticsearch.cluster.routing.allocation.allocator.DesiredBalanceShardsAllocator', 'TRACE'
setting 'logger.org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders', 'TRACE'
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
}

String oldVersion = bwcVersion.toString()

tasks.register("${baseName}#oldClusterTest", StandaloneRestIntegTestTask) {
dependsOn "processTestResources"
useCluster baseCluster
mustRunAfter("precommit")
doFirst {
delete("${buildDir}/cluster/shared/repo/${baseName}")
}
def excludeList = []
systemProperty 'tests.rest.suite', 'old_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(",")))
nonInputProperties.systemProperty('tests.clustername', baseName)
if (bwcVersion.before("8.4.0")) {
excludeList.addAll(["old_cluster/30_vector_search/*"])
} else if (bwcVersion.before("8.6.0")) {
excludeList.addAll(["old_cluster/30_vector_search/Create indexed byte vectors and search"])
}
if (excludeList.isEmpty() == false) {
systemProperty 'tests.rest.blacklist', excludeList.join(',')
}
}

tasks.register("${baseName}#oneThirdUpgradedTest", StandaloneRestIntegTestTask) {
dependsOn "${baseName}#oldClusterTest"
useCluster baseCluster
doFirst {
baseCluster.get().nextNodeToNextVersion()
}
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
systemProperty 'tests.first_round', 'true'
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(",")))
nonInputProperties.systemProperty('tests.clustername', baseName)
def excludeList = []
if (bwcVersion.before("8.4.0")) {
excludeList.addAll(["mixed_cluster/30_vector_search/*"])
} else if (bwcVersion.before("8.6.0")) {
excludeList.addAll(["mixed_cluster/30_vector_search/Search byte indices created in old cluster"])
}
if (excludeList.isEmpty() == false) {
systemProperty 'tests.rest.blacklist', excludeList.join(',')
}
}

tasks.register("${baseName}#twoThirdsUpgradedTest", StandaloneRestIntegTestTask) {
dependsOn "${baseName}#oneThirdUpgradedTest"
useCluster baseCluster
doFirst {
baseCluster.get().nextNodeToNextVersion()
}
systemProperty 'tests.rest.suite', 'mixed_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
systemProperty 'tests.first_round', 'false'
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(",")))
nonInputProperties.systemProperty('tests.clustername', baseName)
def excludeList = []
if (bwcVersion.before("8.4.0")) {
excludeList.addAll(["mixed_cluster/30_vector_search/*"])
} else if (bwcVersion.before("8.6.0")) {
excludeList.addAll(["mixed_cluster/30_vector_search/Search byte indices created in old cluster"])
}
if (excludeList.isEmpty() == false) {
systemProperty 'tests.rest.blacklist', excludeList.join(',')
}
}

tasks.register("${baseName}#upgradedClusterTest", StandaloneRestIntegTestTask) {
dependsOn "${baseName}#twoThirdsUpgradedTest"
doFirst {
baseCluster.get().nextNodeToNextVersion()
}
useCluster testClusters.named(baseName)
systemProperty 'tests.rest.suite', 'upgraded_cluster'
systemProperty 'tests.upgrade_from_version', oldVersion
nonInputProperties.systemProperty('tests.rest.cluster', baseCluster.map(c -> c.allHttpSocketURI.join(",")))
nonInputProperties.systemProperty('tests.clustername', baseName)
def excludeList = []
if (bwcVersion.before("8.4.0")) {
excludeList.addAll(["upgraded_cluster/30_vector_search/*"])
} else if (bwcVersion.before("8.6.0")) {
excludeList.addAll(["upgraded_cluster/30_vector_search/Search byte indices created in old cluster"])
}
if (excludeList.isEmpty() == false) {
systemProperty 'tests.rest.blacklist', excludeList.join(',')
}
}
}

testClusters.configureEach {
setting 'xpack.security.enabled', 'false'
tasks.register(bwcTaskName(bwcVersion)) {
dependsOn tasks.named("${baseName}#upgradedClusterTest")
}
}
Loading

0 comments on commit 06f09d8

Please sign in to comment.