Skip to content

Commit b7da5d9

Browse files
authored
backport code to branch (#123138)
Backports the following commits to 8.18: - Update testing code to fix randomization and unmute test (#123125) that.
1 parent 26de857 commit b7da5d9

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

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)