blockedGetAll.send().receiveAll(); rpcManager.expectCommand(ClusteredGetAllCommand.class).send().receiveAll();
remotePrefetch.receiveAll();
TestingUtil.waitForNoRebalance(c); blockedReplace.send().receiveAll();
sentStateResponse.receiveAll();
crm.expectCommand(PrepareCommand.class).send().receiveAll(); blockedInvalidate1.send().receiveAll(); crm.expectCommand(PrepareCommand.class).send().receiveAll(); } else { crm.expectCommand(CommitCommand.class).send().receiveAll(); crm.expectCommand(TxCompletionNotificationCommand.class).send();
expectStateRequestCommand(crm2, StateRequestCommand.Type.GET_TRANSACTIONS).send().receiveAll(); expectStateRequestCommand(crm2, StateRequestCommand.Type.START_STATE_TRANSFER).send().receiveAll(); ControlledRpcManager.BlockedRequest blockedStateResponse0 = crm0.expectCommand(StateResponseCommand.class); assertTrue(topologyChangeLatch.await(10, TimeUnit.SECONDS)); crm2.expectCommand(BaseClusteredReadCommand.class).send().receiveAll(); crm0.expectCommand(CommitCommand.class).send().receiveAll(); crm0.expectCommand(TxCompletionNotificationCommand.class).send(); blockedStateResponse0.send().receiveAll();
blockedGet.send().receiveAll(); rpcManager0.expectCommand(ClusteredGetCommand.class).send().receiveAll();
nodeARpcManager.expectCommand(PrepareCommand.class).send().receiveAll(); nodeARpcManager.expectCommand(CommitCommand.class).send().receiveAll(); nodeARpcManager.expectCommand(TxCompletionNotificationCommand.class).send(); assertNull("Wrong put() return value.", tx.get());
blockedPrepare.send().receiveAll(); } else { blockedPrepareResponses.receive(); rpcManager.expectCommand(VersionedCommitCommand.class).send().receiveAll();
blockedPrepare.send().receiveAll(); } else { blockedPrepareResponses.receive(); rpcManager.expectCommand(VersionedCommitCommand.class).send().receiveAll();
controlledRpcManager.expectCommand(ClusteredGetCommand.class).send().receiveAll(); blockedPrepare.send().receiveAll(); controlledRpcManager.expectCommand(PrepareCommand.class).send().receiveAll();
ControlledRpcManager.BlockedRequest blockedGet = rpcManager0.expectCommand(ClusteredGetCommand.class); blockedGet.send().receiveAll();
controlledRpcManager.expectCommand(ClusteredGetCommand.class).send().receiveAll(); controlledRpcManager.expectCommand(PrepareCommand.class).send().receiveAll(); blockedCommit.send().receiveAll(); controlledRpcManager.expectCommand(CommitCommand.class).send().receiveAll(); controlledRpcManager.expectCommand(TxCompletionNotificationCommand.class).send();
blockedGet.send().receiveAll(); rpcManager0.expectCommand(ClusteredGetCommand.class).send().receiveAll();
blockedGet.send().receiveAll();
crm.expectCommand(operation.getCommandClass()).send().receiveAll();
blockedGet.send().receiveAll();
blockedStateResponse.send().receiveAll(); Cache cache2 = future.get();
public void testReplicationFailure() throws Exception { Cache<?, ?> cache = cache(0); ControlledRpcManager controlledRpcManager = ControlledRpcManager.replaceRpcManager(cache); try { Future<Void> future = fork(() -> { controlledRpcManager.expectCommand(VersionedPrepareCommand.class).fail(); controlledRpcManager.expectCommand(RollbackCommand.class).send().receiveAll(); }); TransactionManager tm = cache(0).getAdvancedCache().getTransactionManager(); tm.begin(); cache(0).put("k0", "v"); Exceptions.expectException(RollbackException.class, tm::commit); future.get(30, TimeUnit.SECONDS); } finally { controlledRpcManager.revertRpcManager(); } } }
public void testBiasTimesOut() throws Exception { rpcManager0.excludeCommands(ExceptionAckCommand.class); MagicKey key = new MagicKey(cache(0)); cache(1).put(key, "v0"); assertTrue(biasManager(1).hasLocalBias(key)); timeService.advance(BIAS_LIFESPAN + 1); rpcManager0.expectCommand(RevokeBiasCommand.class).send().receiveAll(); // The local bias is invalidated synchronously with the sync command, but it may take few moments // to remove the remote bias. assertFalse(biasManager(1).hasLocalBias(key)); eventuallyEquals(null, () -> biasManager(0).getRemoteBias(key)); }