ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: ignite-1003: added tests
Date Mon, 20 Jul 2015 13:19:12 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-1003 cf0818114 -> 582e2b76a


ignite-1003: added 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/582e2b76
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/582e2b76
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/582e2b76

Branch: refs/heads/ignite-1003
Commit: 582e2b76a091eda79badfb1784b1e3dcc03cfd02
Parents: cf08181
Author: Denis Magda <dmagda@gridgain.com>
Authored: Mon Jul 20 16:19:00 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Mon Jul 20 16:19:00 2015 +0300

----------------------------------------------------------------------
 .../tcp/TcpDiscoveryMultiThreadedTest.java      | 50 +++++++++++++++++++-
 1 file changed, 48 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/582e2b76/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
index 9643235..5fa98d5 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryMultiThreadedTest.java
@@ -22,6 +22,7 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.util.typedef.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
+import org.apache.ignite.spi.communication.tcp.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.*;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
 import org.apache.ignite.testframework.*;
@@ -75,7 +76,14 @@ public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest
{
         if (client())
             cfg.setClientMode(true);
 
-        cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(ipFinder));
+        cfg.setDiscoverySpi(new TcpDiscoverySpi().setIpFinder(ipFinder).setNetworkTimeout(10_000).
+            setSocketTimeout(10_000).setHeartbeatFrequency(10_000));
+
+        TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
+        commSpi.setConnectTimeout(10_000);
+        commSpi.setSocketWriteTimeout(10_000);
+
+        cfg.setCommunicationSpi(commSpi);
 
         cfg.setCacheConfiguration();
 
@@ -95,7 +103,45 @@ public class TcpDiscoveryMultiThreadedTest extends GridCommonAbstractTest
{
 
     /** {@inheritDoc} */
     @Override protected long getTestTimeout() {
-        return 3 * 60 * 1000;
+        return 30 * 60 * 1000;
+    }
+
+    public void testClientInDifferentSubNetServerPart() throws Exception {
+        clientFlagGlobal = false;
+
+        startGridsMultiThreaded(8);
+
+        Thread.sleep(getTestTimeout());
+    }
+
+    public void testClientInDifferentSubNetClientPart() throws Exception {
+        clientFlagGlobal = true;
+
+        final AtomicBoolean done = new AtomicBoolean();
+
+        IgniteInternalFuture<?> fut1 = multithreadedAsync(
+            new Callable<Object>() {
+                @Override public Object call() throws Exception {
+                    clientFlagPerThread.set(true);
+
+                    int idx = 1;
+
+                    while (!done.get()) {
+                        stopGrid(idx);
+                        startGrid(idx);
+                    }
+
+                    return null;
+                }
+            },
+            CLIENT_GRID_CNT
+        );
+
+        Thread.sleep(5 * 60 * 1000);
+
+        done.set(true);
+
+        fut1.get();
     }
 
     /**


Mime
View raw message