Repository: ignite Updated Branches: refs/heads/master 30484c0ad -> dea8df2ce
IGNITE-6010 ZookeeperIpFinderTest.testFourNodesKillRestartZookeeper fails sometimes Signed-off-by: Anton Vinogradov <a...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/dea8df2c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/dea8df2c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/dea8df2c Branch: refs/heads/master Commit: dea8df2ce17747704482deae6b67f9ea46a6014e Parents: 30484c0 Author: NSAmelchev <nsamelc...@gmail.com> Authored: Thu Jun 14 16:53:29 2018 +0300 Committer: Anton Vinogradov <a...@apache.org> Committed: Thu Jun 14 16:53:29 2018 +0300 ---------------------------------------------------------------------- .../tcp/ipfinder/zk/ZookeeperIpFinderTest.java | 28 +++++++++----------- 1 file changed, 13 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/dea8df2c/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTest.java ---------------------------------------------------------------------- diff --git a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTest.java b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTest.java index 20947c4..25598fe 100644 --- a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTest.java +++ b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/tcp/ipfinder/zk/ZookeeperIpFinderTest.java @@ -32,8 +32,6 @@ import org.apache.ignite.Ignite; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.events.Event; import org.apache.ignite.events.EventType; -import org.apache.ignite.internal.util.lang.GridAbsPredicate; -import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteBiPredicate; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.testframework.GridTestUtils; @@ -356,24 +354,24 @@ public class ZookeeperIpFinderTest extends GridCommonAbstractTest { // block the client until connected zkCurator.blockUntilConnected(); - // check that the nodes have registered again + // Check that the nodes have registered again with the previous configuration. assertEquals(4, zkCurator.getChildren().forPath(SERVICES_IGNITE_ZK_PATH).size()); + // Block the clients until connected. + for (int i = 0; i < 4; i++) { + TcpDiscoverySpi spi = (TcpDiscoverySpi)grid(i).configuration().getDiscoverySpi(); + + TcpDiscoveryZookeeperIpFinder zkIpFinder = (TcpDiscoveryZookeeperIpFinder)spi.getIpFinder(); + + CuratorFramework curator = GridTestUtils.getFieldValue(zkIpFinder, "curator"); + + curator.blockUntilConnected(); + } + // stop all grids stopAllGrids(); - assertTrue(GridTestUtils.waitForCondition(new GridAbsPredicate() { - @Override public boolean apply() { - try { - return 0 == zkCurator.getChildren().forPath(SERVICES_IGNITE_ZK_PATH).size(); - } - catch (Exception e) { - U.error(log, "Failed to wait for zk condition", e); - - return false; - } - } - }, 20000)); + assertEquals(0, zkCurator.getChildren().forPath(SERVICES_IGNITE_ZK_PATH).size()); } /**