Skip to content

Commit

Permalink
Fix issue with bwc tests running wrong cluster versions (#58063)
Browse files Browse the repository at this point in the history
We were previously configuring BWC testing tasks by matching on task
name prefix. This naive approach breaks down when you have versions like
1.0.1 and 1.0.10 since they both share a common prefix. This commit
makes the pattern matching more specific so we won't inadvertently
spin up the wrong cluster version.
  • Loading branch information
mark-vieira committed Jun 12, 2020
1 parent af23c38 commit c40f86c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion x-pack/qa/full-cluster-restart/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) {
}

String oldVersion = bwcVersion.toString().minus("-SNAPSHOT")
tasks.matching { it.name.startsWith(baseName) && it.name.endsWith("ClusterTest") }.configureEach {
tasks.matching { it.name.startsWith("${baseName}#") && it.name.endsWith("ClusterTest") }.configureEach {
it.systemProperty 'tests.old_cluster_version', oldVersion
it.systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
it.nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
Expand Down
4 changes: 2 additions & 2 deletions x-pack/qa/rolling-upgrade-multi-cluster/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
numberOfNodes = 3
}
}
testClusters.matching { it.name.startsWith(baseName) }.all {
testClusters.matching { it.name.startsWith("${baseName}-") }.all {
testDistribution = "DEFAULT"
versions = [bwcVersion.toString(), project.version]

Expand All @@ -33,7 +33,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
setting 'xpack.license.self_generated.type', 'trial'
}

tasks.withType(RestTestRunnerTask).matching { it.name.startsWith(baseName) }.all {
tasks.withType(RestTestRunnerTask).matching { it.name.startsWith("${baseName}#") }.all {
useCluster testClusters."${baseName}-leader"
useCluster testClusters."${baseName}-follower"
systemProperty 'tests.upgrade_from_version', bwcVersion.toString().replace('-SNAPSHOT', '')
Expand Down

0 comments on commit c40f86c

Please sign in to comment.