Skip to content

Commit 9188189

Browse files
authored
Update testing code to fix randomization and unmute test (elastic#123135)
1 parent c7c4e68 commit 9188189

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
@@ -250,9 +250,6 @@ tests:
250250
- class: org.elasticsearch.search.basic.SearchWithRandomDisconnectsIT
251251
method: testSearchWithRandomDisconnects
252252
issue: https://github.com/elastic/elasticsearch/issues/116175
253-
- class: org.elasticsearch.action.search.SearchQueryThenFetchAsyncActionTests
254-
method: testMinimumVersionBetweenNewAndOldVersion
255-
issue: https://github.com/elastic/elasticsearch/issues/117485
256253
- class: org.elasticsearch.discovery.ClusterDisruptionIT
257254
method: testAckedIndexing
258255
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
@@ -273,18 +273,22 @@ public void testMinimumVersionSameAsNewVersion() {
273273
}
274274

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

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

0 commit comments

Comments
 (0)