File tree Expand file tree Collapse file tree 1 file changed +15
-14
lines changed
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/indexlifecycle Expand file tree Collapse file tree 1 file changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -48,20 +48,21 @@ protected RolloverAction mutateInstance(RolloverAction instance) throws IOExcept
4848 TimeValue maxAge = instance .getMaxAge ();
4949 Long maxDocs = instance .getMaxDocs ();
5050 switch (between (0 , 2 )) {
51- case 0 :
52- maxSize = randomValueOtherThan (maxSize , () -> {
53- ByteSizeUnit maxSizeUnit = randomFrom (ByteSizeUnit .values ());
54- return new ByteSizeValue (randomNonNegativeLong () / maxSizeUnit .toBytes (1 ), maxSizeUnit );
55- });
56- break ;
57- case 1 :
58- maxAge = TimeValue .parseTimeValue (randomPositiveTimeValue (), "rollover_action_test" );
59- break ;
60- case 2 :
61- maxDocs = randomNonNegativeLong ();
62- break ;
63- default :
64- throw new AssertionError ("Illegal randomisation branch" );
51+ case 0 :
52+ maxSize = randomValueOtherThan (maxSize , () -> {
53+ ByteSizeUnit maxSizeUnit = randomFrom (ByteSizeUnit .values ());
54+ return new ByteSizeValue (randomNonNegativeLong () / maxSizeUnit .toBytes (1 ), maxSizeUnit );
55+ });
56+ break ;
57+ case 1 :
58+ maxAge = randomValueOtherThan (maxAge ,
59+ () -> TimeValue .parseTimeValue (randomPositiveTimeValue (), "rollover_action_test" ));
60+ break ;
61+ case 2 :
62+ maxDocs = maxDocs == null ? randomNonNegativeLong () : maxDocs + 1 ;
63+ break ;
64+ default :
65+ throw new AssertionError ("Illegal randomisation branch" );
6566 }
6667 return new RolloverAction (maxSize , maxAge , maxDocs );
6768 }
You can’t perform that action at this time.
0 commit comments