Examples of awaitStrict()


Examples of org.infinispan.test.fwk.CheckPoint.awaitStrict()

      manager(0).stop();
      TestingUtil.blockUntilViewsReceived(30000, false, manager(1), manager(2));

      // Wait for the GET_STATUS command and stop node 3 abruptly
      int viewId = manager(1).getTransport().getViewId();
      checkpoint.awaitStrict("GET_STATUS_" + viewId, 10, TimeUnit.SECONDS);
      d3.setDiscardAll(true);
      manager(2).stop();
      TestingUtil.blockUntilViewsReceived(30000, false, manager(1));
      checkpoint.trigger("3 left");
View Full Code Here

Examples of org.infinispan.test.fwk.CheckPoint.awaitStrict()

         @Override
         public Object answer(InvocationOnMock invocation) throws Throwable {
            int topologyId = (Integer) invocation.getArguments()[1];
            checkpoint.trigger("GET_TRANSACTIONS");
            log.debugf("Blocking the GET_TRANSACTIONS(%d) command on the %s", topologyId, c2);
            checkpoint.awaitStrict("LEAVE", 10, TimeUnit.SECONDS);
            return invocation.callRealMethod();
         }
      }).when(spyStateProvider).getTransactionsForSegments(any(Address.class), anyInt(), anySet());
      TestingUtil.replaceComponent(c2, StateProvider.class, spyStateProvider, true);
View Full Code Here

Examples of org.infinispan.test.fwk.CheckPoint.awaitStrict()

      TestingUtil.replaceComponent(c2, StateProvider.class, spyStateProvider, true);

      long startTime = System.currentTimeMillis();
      manager(2).stop();

      checkpoint.awaitStrict("GET_TRANSACTIONS", 10, TimeUnit.SECONDS);
      manager(1).stop();
      checkpoint.trigger("LEAVE");

      TestingUtil.blockUntilViewsReceived(30000, false, c1);
      TestingUtil.waitForRehashToComplete(c1);
View Full Code Here

Examples of org.infinispan.test.fwk.CheckPoint.awaitStrict()

            Object[] arguments = invocation.getArguments();
            Address source = (Address) arguments[0];
            int topologyId = (Integer) arguments[1];
            Object result = invocation.callRealMethod();
            checkpoint.trigger("post_get_transactions_" + topologyId + "_from_" + source);
            checkpoint.awaitStrict("resume_get_transactions_" + topologyId + "_from_" + source, 10, SECONDS);
            return result;
         }
      }).when(spyProvider).getTransactionsForSegments(any(Address.class), anyInt(), anySetOf(Integer.class));
      TestingUtil.replaceComponent(cache0, StateProvider.class, spyProvider, true);
View Full Code Here

Examples of org.infinispan.test.fwk.CheckPoint.awaitStrict()

      // Start cache 1, but the tx data request will be blocked on cache 0
      StateTransferManager stm0 = TestingUtil.extractComponent(cache0, StateTransferManager.class);
      int initialTopologyId = stm0.getCacheTopology().getTopologyId();
      int rebalanceTopologyId = initialTopologyId + 1;
      AdvancedCache<Object, Object> cache1 = advancedCache(1, CACHE_NAME);
      checkpoint.awaitStrict("post_get_transactions_" + rebalanceTopologyId + "_from_" + address(1), 10, SECONDS);

      // The commit/rollback command should be invoked on cache 1 and it should block until the tx is created there
      Future<Object> future = fork(new Callable<Object>() {
         @Override
         public Object call() throws Exception {
View Full Code Here

Examples of org.infinispan.test.fwk.CheckPoint.awaitStrict()

            remoteCache.put("key", "value1");
            return null;
         }
      });

      checkPoint.awaitStrict("before-block", 30, TimeUnit.SECONDS);

      try {
         for (int i = 0; i < 50; ++i) {
            try {
               remoteCache.put("key", "value" + i);
View Full Code Here

Examples of org.infinispan.test.fwk.CheckPoint.awaitStrict()

         @Override
         public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable {
            if (first.compareAndSet(false, true)) {
               checkPoint.trigger("before-block");
               checkPoint.awaitStrict("block", 30, TimeUnit.SECONDS);
            }
            return invokeNextInterceptor(ctx, command);
         }
      }, CallInterceptor.class);
      return checkPoint;
View Full Code Here

Examples of org.infinispan.test.fwk.CheckPoint.awaitStrict()

         @Override
         public Object answer(InvocationOnMock invocation) throws Throwable {
            int viewId = (Integer) invocation.getArguments()[2];
            checkpoint.trigger("rebalance_" + viewId);
            log.debugf("Blocking the REBALANCE_START command on the merge coordinator");
            checkpoint.awaitStrict("merge", 10, TimeUnit.SECONDS);
            return invocation.callRealMethod();
         }
      }).when(spyLocalTopologyManager).handleRebalance(eq(CACHE_NAME), any(CacheTopology.class), anyInt());

      final EmbeddedCacheManager cm4 = addClusterEnabledCacheManager(defaultConfig,
View Full Code Here

Examples of org.infinispan.test.fwk.CheckPoint.awaitStrict()

            return cm4.getCache(CACHE_NAME);
         }
      });

      log.debugf("Waiting for the REBALANCE_START command to reach the merge coordinator");
      checkpoint.awaitStrict("rebalance_" + (viewIdAfterSplit + 1), 10, TimeUnit.SECONDS);

      // merge the partitions
      log.debugf("Merging the cluster partitions");
      d1.setDiscardAll(false);
      d2.setDiscardAll(false);
View Full Code Here

Examples of org.infinispan.test.fwk.CheckPoint.awaitStrict()

         @Override
         public Object answer(InvocationOnMock invocation) throws Throwable {
            int viewId = (Integer) invocation.getArguments()[0];
            checkpoint.trigger("GET_STATUS_" + viewId);
            log.debugf("Blocking the GET_STATUS command on the merge coordinator");
            checkpoint.awaitStrict("3 left", 10, TimeUnit.SECONDS);
            return invocation.callRealMethod();
         }
      }).when(spyLocalTopologyManager).handleStatusRequest(anyInt());

      // Node 1 (the coordinator) dies. Node 2 becomes coordinator and tries to call GET_STATUS
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.