@@ -258,17 +258,21 @@ public void run() {
258258 }
259259 }
260260
261- public void testMinimumVersionSameAsNewVersion () throws Exception {
261+ public void testMinimumVersionSameAsNewVersion () {
262262 var newVersion = VersionInformation .CURRENT ;
263263 var oldVersion = new VersionInformation (
264- VersionUtils .randomCompatibleVersion (random (), VersionUtils .getPreviousVersion ()),
264+ VersionUtils .randomVersionBetween (
265+ random (),
266+ Version .CURRENT .minimumCompatibilityVersion (),
267+ VersionUtils .getPreviousVersion (newVersion .nodeVersion ())
268+ ),
265269 IndexVersions .MINIMUM_COMPATIBLE ,
266270 IndexVersionUtils .randomCompatibleVersion (random ())
267271 );
268272 testMixedVersionsShardsSearch (newVersion , oldVersion , newVersion .nodeVersion ());
269273 }
270274
271- public void testMinimumVersionBetweenNewAndOldVersion () throws Exception {
275+ public void testMinimumVersionBetweenNewAndOldVersion () {
272276 var oldVersion = new VersionInformation (
273277 VersionUtils .getFirstVersion (),
274278 IndexVersions .MINIMUM_COMPATIBLE ,
@@ -290,8 +294,7 @@ public void testMinimumVersionBetweenNewAndOldVersion() throws Exception {
290294 testMixedVersionsShardsSearch (newVersion , oldVersion , minVersion );
291295 }
292296
293- private void testMixedVersionsShardsSearch (VersionInformation oldVersion , VersionInformation newVersion , Version minVersion )
294- throws Exception {
297+ private void testMixedVersionsShardsSearch (VersionInformation oldVersion , VersionInformation newVersion , Version minVersion ) {
295298 final TransportSearchAction .SearchTimeProvider timeProvider = new TransportSearchAction .SearchTimeProvider (
296299 0 ,
297300 System .nanoTime (),
@@ -372,7 +375,6 @@ public void onResponse(SearchResponse response) {
372375 responses .add (response );
373376 }
374377
375- ;
376378 },
377379 shardsIter ,
378380 timeProvider ,
@@ -397,7 +399,11 @@ public void onResponse(SearchResponse response) {
397399 public void testMinimumVersionSameAsOldVersion () throws Exception {
398400 var newVersion = VersionInformation .CURRENT ;
399401 var oldVersion = new VersionInformation (
400- VersionUtils .randomCompatibleVersion (random (), VersionUtils .getPreviousVersion ()),
402+ VersionUtils .randomVersionBetween (
403+ random (),
404+ Version .CURRENT .minimumCompatibilityVersion (),
405+ VersionUtils .getPreviousVersion (newVersion .nodeVersion ())
406+ ),
401407 IndexVersions .MINIMUM_COMPATIBLE ,
402408 IndexVersionUtils .randomCompatibleVersion (random ())
403409 );
@@ -553,7 +559,11 @@ public void run() {
553559 public void testMinimumVersionShardDuringPhaseExecution () throws Exception {
554560 var newVersion = VersionInformation .CURRENT ;
555561 var oldVersion = new VersionInformation (
556- VersionUtils .randomCompatibleVersion (random (), VersionUtils .getPreviousVersion ()),
562+ VersionUtils .randomVersionBetween (
563+ random (),
564+ Version .CURRENT .minimumCompatibilityVersion (),
565+ VersionUtils .getPreviousVersion (newVersion .nodeVersion ())
566+ ),
557567 IndexVersions .MINIMUM_COMPATIBLE ,
558568 IndexVersionUtils .randomCompatibleVersion (random ())
559569 );
0 commit comments