use of com.hazelcast.cp.internal.operation.DefaultRaftReplicateOp in project hazelcast by hazelcast.
the class RaftInvocationFailureTest method test_invocationFailsWithFirstMemberLeftException_when_thereAreIndeterminateOperationStateExceptionsAfterwards.
@Test
public void test_invocationFailsWithFirstMemberLeftException_when_thereAreIndeterminateOperationStateExceptionsAfterwards() throws ExecutionException, InterruptedException {
CPGroupId groupId = getRaftInvocationManager(instances[0]).createRaftGroup(groupName).get();
waitAllForLeaderElection(instances, groupId);
HazelcastInstance leader = getLeaderInstance(instances, groupId);
Future f = new RaftInvocation(getOperationService(leader).invocationContext, getRaftInvocationManager(leader).getRaftInvocationContext(), groupId, new DefaultRaftReplicateOp(groupId, new CustomResponseOp4()), 10, 50, 60000).invoke();
try {
f.get(60, TimeUnit.SECONDS);
fail();
} catch (Exception e) {
assertInstanceOf(IndeterminateOperationStateException.class, e.getCause());
}
assertTrue(COMMIT_COUNT.get() > groupSize);
}
Aggregations