Search in sources :

Example 6 with IndeterminateOperationStateException

use of com.hazelcast.core.IndeterminateOperationStateException in project hazelcast by hazelcast.

the class IndeterminateOperationStateExceptionTest method partitionInvocation_shouldFailOnBackupTimeout_whenConfigurationEnabledGlobally.

@Test
public void partitionInvocation_shouldFailOnBackupTimeout_whenConfigurationEnabledGlobally() throws InterruptedException, TimeoutException {
    setup(true);
    dropOperationsBetween(instance1, instance2, F_ID, singletonList(SpiDataSerializerHook.BACKUP));
    int partitionId = getPartitionId(instance1);
    OperationServiceImpl operationService = getNodeEngineImpl(instance1).getOperationService();
    InternalCompletableFuture<Object> future = operationService.createInvocationBuilder(InternalPartitionService.SERVICE_NAME, new PrimaryOperation(), partitionId).invoke();
    try {
        future.get(2, TimeUnit.MINUTES);
        fail();
    } catch (ExecutionException e) {
        assertTrue(e.getCause() instanceof IndeterminateOperationStateException);
    }
}
Also used : IndeterminateOperationStateException(com.hazelcast.core.IndeterminateOperationStateException) ExecutionException(java.util.concurrent.ExecutionException) OperationServiceImpl(com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

IndeterminateOperationStateException (com.hazelcast.core.IndeterminateOperationStateException)6 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)4 QuickTest (com.hazelcast.test.annotation.QuickTest)4 Test (org.junit.Test)4 OperationServiceImpl (com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl)3 ExecutionException (java.util.concurrent.ExecutionException)3 IndeterminateOperationState (com.hazelcast.core.IndeterminateOperationState)1 Data (com.hazelcast.internal.serialization.Data)1 NormalResponse (com.hazelcast.spi.impl.operationservice.impl.responses.NormalResponse)1 AssertTask (com.hazelcast.test.AssertTask)1 TransactionContext (com.hazelcast.transaction.TransactionContext)1