use of org.apache.geode.test.dunit.AsyncInvocation in project geode by apache.
the class SerialWANPropagationDUnitTest method testReplicatedSerialPropagationHA.
@Test
public void testReplicatedSerialPropagationHA() throws Exception {
Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
createCacheInVMs(nyPort, vm2, vm3);
createReceiverInVMs(vm2, vm3);
createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);
vm4.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 10, false, false, null, true));
vm5.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 10, false, false, null, true));
vm2.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", null, isOffHeap()));
vm3.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR", null, isOffHeap()));
startSenderInVMs("ln", vm4, vm5);
vm4.invoke(createReplicatedRegionRunnable());
vm5.invoke(createReplicatedRegionRunnable());
vm6.invoke(createReplicatedRegionRunnable());
vm7.invoke(createReplicatedRegionRunnable());
AsyncInvocation inv1 = vm5.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_RR", 10000));
Wait.pause(2000);
AsyncInvocation inv2 = vm4.invokeAsync(() -> WANTestBase.killSender());
inv1.join();
inv2.join();
vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 10000));
vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR", 10000));
}
use of org.apache.geode.test.dunit.AsyncInvocation in project geode by apache.
the class SerialWANPropagationDUnitTest method testReplicatedSerialPropagationWithRemoteReceiverRestarted_SenderReceiverPersistent.
@Test
public void testReplicatedSerialPropagationWithRemoteReceiverRestarted_SenderReceiverPersistent() throws Exception {
Integer lnPort = (Integer) vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
Integer nyPort = (Integer) vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));
// these are part of remote site
createCacheInVMs(nyPort, vm2);
vm2.invoke(() -> WANTestBase.createReceiver());
// these are part of local site
createCacheInVMs(lnPort, vm4, vm5);
// senders are created on local site. Batch size is kept to a high (170) so
// there will be less number of exceptions (occur during dispatchBatch) in
// the log
vm4.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 350, false, true, null, true));
vm5.invoke(() -> WANTestBase.createSender("ln", 2, false, 100, 350, false, true, null, true));
// create one RR (RR_1) on remote site
vm2.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR_1", null, isOffHeap()));
vm2.invoke(() -> WANTestBase.addListenerToSleepAfterCreateEvent(2000, getTestMethodName() + "_RR_1"));
// start the senders on local site
startSenderInVMs("ln", vm4, vm5);
// create one RR (RR_1) on local site
vm4.invoke(() -> WANTestBase.createReplicatedRegion(getTestMethodName() + "_RR_1", "ln", isOffHeap()));
// start puts in RR_1 in another thread
AsyncInvocation inv1 = vm4.invokeAsync(() -> WANTestBase.doPuts(getTestMethodName() + "_RR_1", 8000));
// close cache in remote site. This will automatically kill the remote
// receivers.
vm2.invoke(() -> WANTestBase.closeCache());
inv1.join();
// verify that all is well in local site
vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR_1", 8000));
vm4.invoke(() -> WANTestBase.verifyRegionQueueNotEmpty("ln"));
createCacheInVMs(nyPort, vm2);
vm2.invoke(() -> WANTestBase.createPersistentReplicatedRegion(getTestMethodName() + "_RR_1", null, isOffHeap()));
vm2.invoke(() -> WANTestBase.createReceiver());
vm4.invoke(() -> WANTestBase.validateQueueContents("ln", 0));
vm2.invoke(() -> WANTestBase.checkMinimumGatewayReceiverStats(1, 1));
vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + "_RR_1", 8000));
}
use of org.apache.geode.test.dunit.AsyncInvocation in project geode by apache.
the class IdleTimeOutDUnitTest method testIdleTimeOut.
@Test
public void testIdleTimeOut() throws Throwable {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
vm0.invoke(() -> IdleTimeOutDUnitTest.runTest1());
AsyncInvocation asyncObj = vm0.invokeAsync(() -> IdleTimeOutDUnitTest.runTest2());
ThreadUtils.join(asyncObj, 30 * 1000);
if (asyncObj.exceptionOccurred()) {
Assert.fail("asyncObj failed", asyncObj.getException());
}
}
use of org.apache.geode.test.dunit.AsyncInvocation in project geode by apache.
the class LoginTimeOutDUnitTest method testLoginTimeOut.
// this test and the setUp and teardown2 methods are disabled due to frequent
// failures in CI runs. See bug #52206
@Ignore("TODO: test is disabled due to #52206")
@Test
public void testLoginTimeOut() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
AsyncInvocation test1 = vm0.invokeAsync(() -> LoginTimeOutDUnitTest.runTest1());
AsyncInvocation test2 = vm0.invokeAsync(() -> LoginTimeOutDUnitTest.runTest2());
ThreadUtils.join(test2, 120 * 1000);
if (test2.exceptionOccurred()) {
Assert.fail("asyncObj failed", test2.getException());
}
ThreadUtils.join(test1, 30000);
}
use of org.apache.geode.test.dunit.AsyncInvocation in project geode by apache.
the class MaxPoolSizeDUnitTest method testMaxPoolSize.
@Test
public void testMaxPoolSize() throws Exception {
Host host = Host.getHost(0);
VM vm0 = host.getVM(0);
AsyncInvocation asyncObj = vm0.invokeAsync(() -> MaxPoolSizeDUnitTest.runTest1());
ThreadUtils.join(asyncObj, 30 * 1000);
if (asyncObj.exceptionOccurred()) {
Assert.fail("asyncObj failed", asyncObj.getException());
}
}
Aggregations