ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [03/13] ignite git commit: IGNITE-2766 Ensure that cache is available after client ID changes. This closes #3077.
Date Wed, 29 Nov 2017 08:43:30 GMT
IGNITE-2766 Ensure that cache is available after client ID changes. This closes #3077.

Signed-off-by: nikolay_tikhonov <ntikhonov@gridgain.com>


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5e7a5565
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5e7a5565
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5e7a5565

Branch: refs/heads/ignite-zk
Commit: 5e7a556572b8c3a65bca9c01630466af26644f5e
Parents: 150449c
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Mon Nov 27 13:08:00 2017 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Mon Nov 27 13:08:00 2017 +0300

----------------------------------------------------------------------
 .../internal/IgniteClientReconnectCacheTest.java       | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5e7a5565/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 2e1f2f3..1c10bf1 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
@@ -85,6 +85,7 @@ import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
 import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
 import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
 import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
+import static org.junit.Assert.assertNotEquals;
 
 /**
  *
@@ -1284,13 +1285,15 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
      * @param c Cache operation closure.
      * @throws Exception If failed.
      */
-    private void checkOperationInProgressFails(IgniteEx client,
+    private void checkOperationInProgressFails(final IgniteEx client,
         final CacheConfiguration<Object, Object> ccfg,
         Class<?> msgToBlock,
         final IgniteInClosure<IgniteCache<Object, Object>> c)
         throws Exception {
         Ignite srv = clientRouter(client);
 
+        final UUID id = client.localNode().id();
+
         TestTcpDiscoverySpi srvSpi = spi(srv);
 
         final IgniteCache<Object, Object> cache = client.getOrCreateCache(ccfg);
@@ -1306,6 +1309,8 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
                 IgniteClientDisconnectedException e0 = null;
 
                 try {
+                    assertEquals(id, client.localNode().id());
+
                     c.apply(cache);
 
                     fail();
@@ -1329,6 +1334,8 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
 
                 e0.reconnectFuture().get();
 
+                assertNotEquals(id, client.localNode().id());
+
                 c.apply(cache);
 
                 return null;
@@ -1351,6 +1358,8 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
                 ((TestCommunicationSpi)grid(i).configuration().getCommunicationSpi()).stopBlock(false);
         }
 
+        assertNotEquals(id, client.localNode().id());
+
         cache.put(1, 1);
 
         GridTestUtils.waitForCondition(new GridAbsPredicate() {
@@ -1508,4 +1517,4 @@ public class IgniteClientReconnectCacheTest extends IgniteClientReconnectAbstrac
             }
         }
     }
-}
\ No newline at end of file
+}


Mime
View raw message