fix PolicyStatsTests mutateInstance (#34835)
through randomization, there is a chance that the mutateInstance for PolicyStatsTests does not actually mutate the original object. This PR aims to fix this
This commit is contained in:
parent
0b26f8b14c
commit
21b9b024c7
|
@ -38,10 +38,10 @@ public class PolicyStatsTests extends AbstractWireSerializingTestCase<PolicyStat
|
|||
switch (between(0, 1)) {
|
||||
case 0:
|
||||
phaseStats = new HashMap<>(instance.getPhaseStats());
|
||||
phaseStats.put(randomAlphaOfLengthBetween(1, 20), PhaseStatsTests.createRandomInstance());
|
||||
phaseStats.put(randomAlphaOfLengthBetween(21, 25), PhaseStatsTests.createRandomInstance());
|
||||
break;
|
||||
case 1:
|
||||
indicesManaged = randomIntBetween(1, 50);
|
||||
indicesManaged = randomIntBetween(11, 50);
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError("Illegal randomisation branch");
|
||||
|
|
|
@ -39,7 +39,7 @@ public class PolicyStatsTests extends AbstractWireSerializingTestCase<PolicyStat
|
|||
switch (between(0, 1)) {
|
||||
case 0:
|
||||
phaseStats = new HashMap<>(phaseStats);
|
||||
phaseStats.put(randomAlphaOfLength(10), PhaseStatsTests.randomPhaseStats());
|
||||
phaseStats.put(randomAlphaOfLength(11), PhaseStatsTests.randomPhaseStats());
|
||||
break;
|
||||
case 1:
|
||||
numberIndicesManaged += randomIntBetween(1, 10);
|
||||
|
|
Loading…
Reference in New Issue