ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/2] ignite git commit: IgniteCacheClientMultiNodeUpdateTopologyLockTest minor.
Date Mon, 24 Apr 2017 10:22:16 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-2.0 7378bc38a -> 1214d7e7e


IgniteCacheClientMultiNodeUpdateTopologyLockTest minor.


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

Branch: refs/heads/ignite-2.0
Commit: 319280678515e4e12c10c0362883f207919e87c2
Parents: 1968e4f
Author: sboikov <sboikov@gridgain.com>
Authored: Mon Apr 24 13:20:59 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Mon Apr 24 13:20:59 2017 +0300

----------------------------------------------------------------------
 ...heClientMultiNodeUpdateTopologyLockTest.java | 28 +++++++++++++-------
 1 file changed, 18 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/31928067/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientMultiNodeUpdateTopologyLockTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientMultiNodeUpdateTopologyLockTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientMultiNodeUpdateTopologyLockTest.java
index 4adf5f4..7711bbb 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientMultiNodeUpdateTopologyLockTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/IgniteCacheClientMultiNodeUpdateTopologyLockTest.java
@@ -100,7 +100,7 @@ public class IgniteCacheClientMultiNodeUpdateTopologyLockTest extends
GridCommon
 
         TestRecordingCommunicationSpi spi2 = TestRecordingCommunicationSpi.spi(ignite(2));
 
-        TestRecordingCommunicationSpi clientSpi = TestRecordingCommunicationSpi.spi(clientNode);
+        final TestRecordingCommunicationSpi clientSpi = TestRecordingCommunicationSpi.spi(clientNode);
 
         final UUID node0Id = ignite(0).cluster().localNode().id();
         final UUID node2Id = ignite(2).cluster().localNode().id();
@@ -115,22 +115,30 @@ public class IgniteCacheClientMultiNodeUpdateTopologyLockTest extends
GridCommon
             }
         });
 
-        clientSpi.record(new IgniteBiPredicate<ClusterNode, Message>() {
-            @Override public boolean apply(ClusterNode node, Message msg) {
+        clientSpi.blockMessages(new IgniteBiPredicate<ClusterNode, Message>() {
+            @Override public boolean apply(final ClusterNode node, final Message msg) {
                 if (!node2Id.equals(node.id()))
                     return false;
 
                 if (msg instanceof GridNearTxFinishRequest) {
                     log.info("Delay message [msg=" + msg + ']');
 
-                    try {
-                        Thread.sleep(5000);
-                    }
-                    catch (InterruptedException e) {
-                        e.printStackTrace();
-                    }
+                    GridTestUtils.runAsync(new Runnable() {
+                        @Override public void run() {
+                            try {
+                                Thread.sleep(5000);
+                            }
+                            catch (InterruptedException e) {
+                                e.printStackTrace();
+                            }
+
+                            log.info("Send delayed message [msg=" + msg + ']');
+
+                            clientSpi.stopBlock(true);
+                        }
+                    });
 
-                    log.info("Send delayed message [msg=" + msg + ']');
+                    return true;
                 }
 
                 return false;


Mime
View raw message