use of org.apache.ignite.testframework.ListeningTestLogger in project ignite by apache.
the class GridCachePartitionsUpdateCountersAndSizeTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
super.beforeTest();
stopAllGrids();
testLog = new ListeningTestLogger(log);
}
use of org.apache.ignite.testframework.ListeningTestLogger in project ignite by apache.
the class ExchangeLatchManagerTest method testExcessAcknowledgeForNewCoordinator.
/**
* Checks reaction of latch on stale acknowledge from new coordinator.
*
* @throws Exception If failed.
*/
@Test
public void testExcessAcknowledgeForNewCoordinator() throws Exception {
gridLogger = new ListeningTestLogger(log);
LogListener staleMessageLsnr = LogListener.matches(STALE_ACK_LOG_MSG).build();
LogListener errorLsnr = LogListener.matches(ERROR_MSG).build();
IgniteEx ignite0 = startGrids(3);
awaitPartitionMapExchange();
TestRecordingCommunicationSpi spi0 = TestRecordingCommunicationSpi.spi(ignite0);
spi0.blockMessages((node, msg) -> msg instanceof LatchAckMessage && node.order() == 2);
spi0.record((node, msg) -> msg instanceof LatchAckMessage && node.order() == 3);
Ignite ignite1 = G.allGrids().stream().filter(node -> node.cluster().localNode().order() == 2).findAny().get();
assertNotNull("Could not find node with second order.", ignite1);
TestRecordingCommunicationSpi spi1 = TestRecordingCommunicationSpi.spi(ignite1);
spi1.blockMessages((node, msg) -> {
if (msg instanceof LatchAckMessage && node.order() == 3) {
LatchAckMessage ack = (LatchAckMessage) msg;
return ack.topVer().topologyVersion() == 3;
}
return false;
});
IgniteInternalFuture exchangeDoingFut = GridTestUtils.runAsync(() -> ignite0.createCache(new CacheConfiguration<>(DEFAULT_CACHE_NAME)));
spi0.waitForBlocked();
spi0.waitForRecorded();
ignite0.close();
spi1.waitForBlocked();
awaitPartitionMapExchange();
assertTrue(exchangeDoingFut.isDone());
gridLogger.registerAllListeners(errorLsnr, staleMessageLsnr);
spi1.stopBlock();
assertTrue(GridTestUtils.waitForCondition(() -> staleMessageLsnr.check(), 10_000));
assertFalse(errorLsnr.check());
}
use of org.apache.ignite.testframework.ListeningTestLogger in project ignite by apache.
the class CleanupRestoredCachesSlowTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
ListeningTestLogger testLog = new ListeningTestLogger(false, super.getConfiguration(igniteInstanceName).getGridLogger());
testLog.registerListener(logLsnr);
return super.getConfiguration(igniteInstanceName).setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true).setInitialSize(100 * 1024L * 1024L).setMaxSize(1024 * 1024L * 1024L).setMetricsEnabled(true)).setFileIOFactory(new SlowFileIOFactory())).setCacheConfiguration(new CacheConfiguration().setName(CACHE_NAME).setBackups(1)).setGridLogger(testLog);
}
use of org.apache.ignite.testframework.ListeningTestLogger in project ignite by apache.
the class CacheRebalanceWithRemovedWalSegment method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
super.beforeTest();
stopAllGrids();
cleanPersistenceDir();
listeningLog = new ListeningTestLogger(log);
}
use of org.apache.ignite.testframework.ListeningTestLogger in project ignite by apache.
the class GridP2PContinuousDeploymentClientDisconnectTest method beforeTest.
/**
* {@inheritDoc}
*/
@Override
protected void beforeTest() throws Exception {
super.beforeTest();
testLog = new ListeningTestLogger(true, log);
startGrid(0);
startClientGrid(1);
blockClassLoadingRequest(grid(1));
}
Aggregations