[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:
parent
5f0c036183
commit
0b45fb98b9
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue