[Zen2] Generate coordinationMetaData with different configs (#35991)

This PR fixes test failure, which is caused by equal randomly generated lastAcceptedConfiguration and lastCommittedConfguration.
This commit is contained in:
Andrey Ershov 2018-11-28 14:49:07 +01:00 committed by GitHub
parent 5f0c036183
commit 0b45fb98b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -221,7 +221,12 @@ public class GatewayMetaStatePersistedStateTests extends ESTestCase {
public void testMarkAcceptedConfigAsCommitted() throws IOException {
GatewayMetaStateUT gateway = newGateway();
CoordinationMetaData coordinationMetaData = createCoordinationMetaData(randomNonNegativeLong());
//generate random coordinationMetaData with different lastAcceptedConfiguration and lastCommittedConfiguration
CoordinationMetaData coordinationMetaData;
do {
coordinationMetaData = createCoordinationMetaData(randomNonNegativeLong());
} while (coordinationMetaData.getLastAcceptedConfiguration().equals(coordinationMetaData.getLastCommittedConfiguration()));
ClusterState state = createClusterState(randomNonNegativeLong(),
MetaData.builder().coordinationMetaData(coordinationMetaData).build());
gateway.setLastAcceptedState(state);