use of org.apache.ignite.events.EventType.EVT_CLIENT_NODE_DISCONNECTED in project ignite by apache.
the class ServiceDeploymentOnClientDisconnectTest method runTaskWhenDisconnected.
/**
* Apply given task on disconnected client node.
*
* @param task Task.
* @throws InterruptedException If interrupted.
*/
private void runTaskWhenDisconnected(final Runnable task) throws InterruptedException {
Ignite client = client();
CountDownLatch latch = new CountDownLatch(1);
client.events().localListen((IgnitePredicate<Event>) evt -> {
latch.countDown();
return false;
}, EVT_CLIENT_NODE_DISCONNECTED);
server().close();
assertTrue(latch.await(CLIENT_FAILURE_DETECTION_TIMEOUT * 2 + CLIENT_FAILURE_DETECTION_TIMEOUT / 10, TimeUnit.MILLISECONDS));
task.run();
}
Aggregations