Fixed test to do not hang if some asserts fail.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/2d62bbb9 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/2d62bbb9 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/2d62bbb9 Branch: refs/heads/ignite-1537 Commit: 2d62bbb96b568b0cf45f29540a2b440f1cbb0a34 Parents: e706216 Author: sboikov <sboi...@gridgain.com> Authored: Fri Nov 27 11:07:49 2015 +0300 Committer: sboikov <sboi...@gridgain.com> Committed: Fri Nov 27 11:07:49 2015 +0300 ---------------------------------------------------------------------- .../IgniteClientReconnectCacheTest.java | 26 ++++++++++++-------- 1 file changed, 16 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/2d62bbb9/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java index 3d8f601..14a770a 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/IgniteClientReconnectCacheTest.java @@ -723,15 +723,18 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac TestTcpDiscoverySpi srvSpi = spi(srv); - assertTrue(joinLatch.await(5000, MILLISECONDS)); - - U.sleep(1000); + try { + assertTrue(joinLatch.await(5000, MILLISECONDS)); - assertNotDone(fut); + U.sleep(1000); - srvSpi.failNode(clientId, null); + assertNotDone(fut); - srvCommSpi.stopBlock(false); + srvSpi.failNode(clientId, null); + } + finally { + srvCommSpi.stopBlock(false); + } assertTrue(fut.get()); } @@ -1286,10 +1289,13 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac srvSpi.failNode(client.localNode().id(), null); - fut.get(); - - for (int i = 0; i < SRV_CNT; i++) - ((TestCommunicationSpi)grid(i).configuration().getCommunicationSpi()).stopBlock(false); + try { + fut.get(); + } + finally { + for (int i = 0; i < SRV_CNT; i++) + ((TestCommunicationSpi)grid(i).configuration().getCommunicationSpi()).stopBlock(false); + } cache.put(1, 1);