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:
Tal Levy 2018-10-25 07:24:54 -07:00 committed by GitHub
parent 0b26f8b14c
commit 21b9b024c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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");

View File

@ -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);