Skip to content

Commit 93ff479

Browse files
committed
Fix issue with bwc tests running wrong cluster versions (#58063)
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.
1 parent 9439084 commit 93ff479

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

x-pack/qa/full-cluster-restart/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.indexCompatible) {
9393
}
9494

9595
String oldVersion = bwcVersion.toString().minus("-SNAPSHOT")
96-
tasks.matching { it.name.startsWith(baseName) && it.name.endsWith("ClusterTest") }.configureEach {
96+
tasks.matching { it.name.startsWith("${baseName}#") && it.name.endsWith("ClusterTest") }.configureEach {
9797
it.systemProperty 'tests.old_cluster_version', oldVersion
9898
it.systemProperty 'tests.path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
9999
it.nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")

x-pack/qa/rolling-upgrade-multi-cluster/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
2121
numberOfNodes = 3
2222
}
2323
}
24-
testClusters.matching { it.name.startsWith(baseName) }.all {
24+
testClusters.matching { it.name.startsWith("${baseName}-") }.all {
2525
testDistribution = "DEFAULT"
2626
versions = [bwcVersion.toString(), project.version]
2727

@@ -32,7 +32,7 @@ for (Version bwcVersion : BuildParams.bwcVersions.wireCompatible) {
3232
setting 'xpack.license.self_generated.type', 'trial'
3333
}
3434

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

0 commit comments

Comments
 (0)