Skip to content

Commit de31cc6

Browse files
authored
Fix ClusterRequestTests (elastic#121570) (elastic#121621)
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 ca894a0 commit de31cc6

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
@@ -335,9 +335,6 @@ tests:
335335
issue: https://github.com/elastic/elasticsearch/issues/117805
336336
- class: org.elasticsearch.xpack.security.authc.ldap.UserAttributeGroupsResolverTests
337337
issue: https://github.com/elastic/elasticsearch/issues/116537
338-
- class: org.elasticsearch.xpack.esql.plugin.ClusterRequestTests
339-
method: testFallbackIndicesOptions
340-
issue: https://github.com/elastic/elasticsearch/issues/117937
341338
- class: org.elasticsearch.repositories.s3.RepositoryS3EcsCredentialsRestIT
342339
method: testNonexistentBucketReadonlyFalse
343340
issue: https://github.com/elastic/elasticsearch/issues/118225

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)