@Override public void close() { if (ref.isAlive() && !ref.isInterrupted()) { log.warnf("There was a thread %s still alive after test completion - interrupted it", ref); ref.interrupt(); } } }
@BeforeClass(alwaysRun = true) @Override public void createBeforeClass() throws Throwable { Util.recursiveFileRemove(PERSISTENT_LOCATION); if (!new File(PERSISTENT_LOCATION).mkdirs()) { log.warnf("Unable to create persistent location file: '%s'", PERSISTENT_LOCATION); } super.createBeforeClass(); }
run.set(false); for (Thread t : threads) t.join(); if (!warmup) log.warnf("%s: Performance: %s", dc.getClass().getSimpleName(), perf);
protected void testWith(String cacheName) throws Exception { log.warnf("Starting profile test, cache name = %s", cacheName); initTest(); cache = cacheManager.getCache(cacheName); runCompleteTest(cacheName); }
@Override public void handleFromCluster(Address origin, ReplicableCommand command, Reply reply, DeliverOrder order) { if (command instanceof CacheTopologyControlCommand) { try { checkPoint.trigger("blocked_" + index); checkPoint.awaitStrict("unblocked_" + index, 10, SECONDS); } catch (Exception e) { log.warnf(e, "Error while blocking before command %s", command); } } delegate.handleFromCluster(origin, command, reply, order); }
private static void viewsTimedOut(CacheContainer[] cacheContainers) { int length = cacheContainers.length; List<View> incompleteViews = new ArrayList<>(length); for (CacheContainer cacheContainer : cacheContainers) { EmbeddedCacheManager cm = (EmbeddedCacheManager) cacheContainer; if (cm.getMembers().size() != cacheContainers.length) { incompleteViews.add(((JGroupsTransport) cm.getTransport()).getChannel().getView()); log.warnf("Manager %s has an incomplete view: %s", cm.getAddress(), cm.getMembers()); } } throw new TimeoutException(String.format( "Timed out before caches had complete views. Expected %d members in each view. Views are as follows: %s", cacheContainers.length, incompleteViews)); }
protected void testWith(String cachename) throws Exception { log.warnf("Starting slave, cache name = %s", cachename); initTest(); cache = cacheManager.getCache(cachename); System.out.println("Waiting for members to join."); TestingUtil.blockUntilViewReceived(cache, 2, 120000, true); System.out.println("Cluster ready, cache mode is " + cache.getCacheConfiguration().clustering().cacheMode()); System.out.println("Waiting for test completion. Hit CTRL-C when done."); doTest(); waitForTest(); }
log.warnf("Already a value present for key %s: %s", key, existing); sameKeyMultipleTimes.set(true); InternalMetadata prevMetadata = metadata.put(key, me.getMetadata()); if (prevMetadata != null) { log.warnf("Already a metadata present for key %s: %s", key, prevMetadata); sameKeyMultipleTimes.set(true);
protected void assertNoLocks(String cacheName) { eventually("Expected no locks acquired in all nodes.", () -> { for (Cache<?, ?> cache : caches(cacheName)) { LockManager lockManager = extractLockManager(cache); getLog().tracef("Locks info=%s", lockManager.printLockInfo()); if (lockManager.getNumberOfLocksHeld() != 0) { getLog().warnf("Locks acquired on cache '%s'", cache); return false; } } return true; }, 30000, 500, TimeUnit.MILLISECONDS); }