ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sevdoki...@apache.org
Subject [28/31] incubator-ignite git commit: IGNITE-836 Fix broken tests.
Date Fri, 15 May 2015 10:06:49 GMT
IGNITE-836 Fix broken tests.


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

Branch: refs/heads/ignite-709_2
Commit: 5e0bbf2332cf64666e1e0aa65754e682fa442cc9
Parents: fce94eb
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Thu May 14 21:16:53 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Thu May 14 21:16:53 2015 +0300

----------------------------------------------------------------------
 .../spi/discovery/tcp/TcpClientDiscoverySpi.java    | 16 ++++++++++++++++
 .../tcp/TcpClientDiscoverySpiSelfTest.java          |  2 ++
 2 files changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e0bbf23/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
index 7abdd4e..9c59bd4 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
@@ -670,6 +670,22 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements
Tcp
     }
 
     /**
+     * FOR TEST PURPOSE ONLY!
+     */
+    public void waitForMessagePrecessed() {
+        Object last = msgWorker.queue.peekLast();
+
+        while (last != null && msgWorker.queue.contains(last)) {
+            try {
+                Thread.sleep(10);
+            }
+            catch (InterruptedException ignored) {
+                Thread.currentThread().interrupt();
+            }
+        }
+    }
+
+    /**
      * Heartbeat sender.
      */
     private class HeartbeatSender extends TimerTask {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5e0bbf23/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
index 475ccb6..64e4488 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpiSelfTest.java
@@ -986,6 +986,8 @@ public class TcpClientDiscoverySpiSelfTest extends GridCommonAbstractTest
{
         for (int i = 0; i < clientCnt; i++) {
             Ignite g = G.ignite("client-" + i);
 
+            ((TcpClientDiscoverySpi)g.configuration().getDiscoverySpi()).waitForMessagePrecessed();
+
             assertTrue(clientNodeIds.contains(g.cluster().localNode().id()));
 
             assertTrue(g.cluster().localNode().isClient());


Mime
View raw message