Skip to content

Commit cfd2f85

Browse files
dnhatnfzowl
authored andcommitted
Fix ClusterRequestTests (elastic#121570)
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 elastic#117937
1 parent 8dafdfe commit cfd2f85

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@ tests:
122122
- class: org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT
123123
method: test {p0=search.highlight/50_synthetic_source/text multi unified from vectors}
124124
issue: https://github.com/elastic/elasticsearch/issues/117815
125-
- class: org.elasticsearch.xpack.esql.plugin.ClusterRequestTests
126-
method: testFallbackIndicesOptions
127-
issue: https://github.com/elastic/elasticsearch/issues/117937
128125
- class: org.elasticsearch.xpack.ml.integration.RegressionIT
129126
method: testTwoJobsWithSameRandomizeSeedUseSameTrainingSet
130127
issue: https://github.com/elastic/elasticsearch/issues/117805

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,14 @@ protected ClusterComputeRequest mutateInstance(ClusterComputeRequest in) throws
155155

156156
public void testFallbackIndicesOptions() throws Exception {
157157
ClusterComputeRequest request = createTestInstance();
158-
var version = TransportVersionUtils.randomVersionBetween(random(), TransportVersions.V_8_14_0, TransportVersions.V_8_16_0);
159-
ClusterComputeRequest cloned = copyInstance(request, version);
158+
var oldVersion = TransportVersionUtils.randomVersionBetween(
159+
random(),
160+
TransportVersions.V_8_14_0,
161+
TransportVersionUtils.getPreviousVersion(TransportVersions.V_8_16_0)
162+
);
163+
ClusterComputeRequest cloned = copyInstance(request, oldVersion);
160164
assertThat(cloned.clusterAlias(), equalTo(request.clusterAlias()));
161165
assertThat(cloned.sessionId(), equalTo(request.sessionId()));
162-
assertThat(cloned.configuration(), equalTo(request.configuration()));
163166
RemoteClusterPlan plan = cloned.remoteClusterPlan();
164167
assertThat(plan.plan(), equalTo(request.remoteClusterPlan().plan()));
165168
assertThat(plan.targetIndices(), equalTo(request.remoteClusterPlan().targetIndices()));

0 commit comments

Comments
 (0)