Skip to content

Commit

Permalink
Fix ActionConfigStatsTests.testEqualsAndHashcode (elastic#74849)
Browse files Browse the repository at this point in the history
This change fixes failing ActionConfigStatsTests.testEqualsAndHashcode by making sure we use different shrink number of shards after mutation.

Closes elastic#74817
  • Loading branch information
probakowski authored and elasticsearchmachine committed Jul 5, 2021
1 parent 9efc37e commit 2d81f23
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected ActionConfigStats mutateInstance(ActionConfigStats instance) throws IO
builder.setShrinkMaxPrimaryShardSize(randomPrimaryByteSize);
break;
case 8:
builder.setShrinkNumberOfShards(randomIntBetween(0, 50));
builder.setShrinkNumberOfShards(randomValueOtherThan(instance.getShrinkNumberOfShards(), () -> randomIntBetween(0, 50)));
break;
default:
throw new IllegalStateException("Illegal randomization branch");
Expand Down

0 comments on commit 2d81f23

Please sign in to comment.