ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agoncha...@apache.org
Subject [02/15] ignite git commit: Fixed whole cluster restart test
Date Mon, 22 May 2017 17:44:25 GMT
Fixed whole cluster restart test


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

Branch: refs/heads/ignite-5267
Commit: 05c6c4ebfba2f820eb1bdfec57cd4fe353d83b49
Parents: 3f92485
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Mon May 22 11:18:29 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Mon May 22 11:18:51 2017 +0300

----------------------------------------------------------------------
 .../db/IgniteDbWholeClusterRestartSelfTest.java | 28 ++++++++++++++------
 1 file changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/05c6c4eb/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbWholeClusterRestartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbWholeClusterRestartSelfTest.java
b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbWholeClusterRestartSelfTest.java
index cce3b6e..fa988f2 100644
--- a/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbWholeClusterRestartSelfTest.java
+++ b/modules/pds/src/test/java/org/apache/ignite/cache/database/db/IgniteDbWholeClusterRestartSelfTest.java
@@ -34,6 +34,7 @@ import org.apache.ignite.configuration.MemoryPolicyConfiguration;
 import org.apache.ignite.configuration.PersistenceConfiguration;
 import org.apache.ignite.internal.processors.cache.database.wal.FileWriteAheadLogManager;
 import org.apache.ignite.internal.util.typedef.internal.U;
+import org.apache.ignite.spi.checkpoint.noop.NoopCheckpointSpi;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 
 /**
@@ -76,6 +77,10 @@ public class IgniteDbWholeClusterRestartSelfTest extends GridCommonAbstractTest
         ccfg1.setBackups(2);
 
         cfg.setLateAffinityAssignment(false);
+        cfg.setActiveOnStart(false);
+
+        // To avoid hostname lookup on start.
+        cfg.setCheckpointSpi(new NoopCheckpointSpi());
 
         cfg.setCacheConfiguration(ccfg1);
 
@@ -122,6 +127,8 @@ public class IgniteDbWholeClusterRestartSelfTest extends GridCommonAbstractTest
     public void testRestarts() throws Exception {
         startGrids(GRID_CNT);
 
+        ignite(0).active(true);
+
         awaitPartitionMapExchange();
 
         try (IgniteDataStreamer<Object, Object> ds = ignite(0).dataStreamer(CACHE_NAME))
{
@@ -144,16 +151,21 @@ public class IgniteDbWholeClusterRestartSelfTest extends GridCommonAbstractTest
             for (Integer idx : idxs)
                 startGrid(idx);
 
-            for (int g = 0; g < GRID_CNT; g++) {
-                Ignite ig = ignite(g);
+            try {
+                ignite(0).active(true);
 
-                for (int k = 0; k < ENTRIES_COUNT; k++)
-                    assertEquals("Failed to read [g=" + g + ", part=" + ig.affinity(CACHE_NAME).partition(k)
+
-                        ", nodes=" + ig.affinity(CACHE_NAME).mapKeyToPrimaryAndBackups(k)
+ ']',
-                        k, ig.cache(CACHE_NAME).get(k));
-            }
+                for (int g = 0; g < GRID_CNT; g++) {
+                    Ignite ig = ignite(g);
 
-            stopAllGrids();
+                    for (int k = 0; k < ENTRIES_COUNT; k++)
+                        assertEquals("Failed to read [g=" + g + ", part=" + ig.affinity(CACHE_NAME).partition(k)
+
+                            ", nodes=" + ig.affinity(CACHE_NAME).mapKeyToPrimaryAndBackups(k)
+ ']',
+                            k, ig.cache(CACHE_NAME).get(k));
+                }
+            }
+            finally {
+                stopAllGrids();
+            }
         }
     }
 }


Mime
View raw message