Skip to content

Commit 11fda75

Browse files
authored
Update testing code to fix randomization and unmute test
1 parent 14f27d5 commit 11fda75

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,6 @@ tests:
247247
- class: org.elasticsearch.search.basic.SearchWithRandomDisconnectsIT
248248
method: testSearchWithRandomDisconnects
249249
issue: https://github.com/elastic/elasticsearch/issues/116175
250-
- class: org.elasticsearch.action.search.SearchQueryThenFetchAsyncActionTests
251-
method: testMinimumVersionBetweenNewAndOldVersion
252-
issue: https://github.com/elastic/elasticsearch/issues/117485
253250
- class: org.elasticsearch.discovery.ClusterDisruptionIT
254251
method: testAckedIndexing
255252
issue: https://github.com/elastic/elasticsearch/issues/117024

server/src/test/java/org/elasticsearch/action/search/SearchQueryThenFetchAsyncActionTests.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,18 +272,22 @@ public void testMinimumVersionSameAsNewVersion() {
272272
}
273273

274274
public void testMinimumVersionBetweenNewAndOldVersion() {
275-
var oldVersion = new VersionInformation(
276-
VersionUtils.getFirstVersion(),
277-
IndexVersions.MINIMUM_COMPATIBLE,
278-
IndexVersionUtils.randomCompatibleVersion(random())
279-
);
280-
281275
var newVersion = new VersionInformation(
282276
VersionUtils.maxCompatibleVersion(VersionUtils.getFirstVersion()),
283277
IndexVersions.MINIMUM_COMPATIBLE,
284278
IndexVersion.current()
285279
);
286280

281+
var oldVersion = new VersionInformation(
282+
VersionUtils.randomVersionBetween(
283+
random(),
284+
Version.CURRENT.minimumCompatibilityVersion(),
285+
VersionUtils.getPreviousVersion(newVersion.nodeVersion())
286+
),
287+
IndexVersions.MINIMUM_COMPATIBLE,
288+
IndexVersionUtils.randomCompatibleVersion(random())
289+
);
290+
287291
var minVersion = VersionUtils.randomVersionBetween(
288292
random(),
289293
allVersions().get(allVersions().indexOf(oldVersion.nodeVersion()) + 1),

0 commit comments

Comments
 (0)