Skip to content

Commit 9c42846

Browse files
authored
Fix ClusterRequestTests (#121570) (#121619)
The upper bound of randomVersionBetween is inclusive; therefore, for testing the fallback version of the request, we need to use the version preceding 8.16.0 rather than 8.16.0 itself. Closes #117937
1 parent 6906446 commit 9c42846

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,6 @@ tests:
324324
- class: org.elasticsearch.xpack.spatial.search.GeoGridAggAndQueryConsistencyIT
325325
method: testGeoPointGeoTile
326326
issue: https://github.com/elastic/elasticsearch/issues/115818
327-
- class: org.elasticsearch.xpack.esql.plugin.ClusterRequestTests
328-
method: testFallbackIndicesOptions
329-
issue: https://github.com/elastic/elasticsearch/issues/117937
330327
- class: org.elasticsearch.gradle.internal.InternalDistributionBwcSetupPluginFuncTest
331328
method: "builds distribution from branches via archives extractedAssemble [bwcDistVersion: 8.1.3, bwcProject: bugfix2, expectedAssembleTaskName:
332329
extractedAssemble, #3]"

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/plugin/ClusterRequestTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,14 @@ protected ClusterComputeRequest mutateInstance(ClusterComputeRequest in) throws
156156

157157
public void testFallbackIndicesOptions() throws Exception {
158158
ClusterComputeRequest request = createTestInstance();
159-
var version = TransportVersionUtils.randomVersionBetween(
159+
var oldVersion = TransportVersionUtils.randomVersionBetween(
160160
random(),
161161
TransportVersions.V_8_14_0,
162-
TransportVersions.ESQL_ORIGINAL_INDICES
162+
TransportVersionUtils.getPreviousVersion(TransportVersions.ESQL_ORIGINAL_INDICES)
163163
);
164-
ClusterComputeRequest cloned = copyInstance(request, version);
164+
ClusterComputeRequest cloned = copyInstance(request, oldVersion);
165165
assertThat(cloned.clusterAlias(), equalTo(request.clusterAlias()));
166166
assertThat(cloned.sessionId(), equalTo(request.sessionId()));
167-
assertThat(cloned.configuration(), equalTo(request.configuration()));
168167
RemoteClusterPlan plan = cloned.remoteClusterPlan();
169168
assertThat(plan.plan(), equalTo(request.remoteClusterPlan().plan()));
170169
assertThat(plan.targetIndices(), equalTo(request.remoteClusterPlan().targetIndices()));

0 commit comments

Comments
 (0)