You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/05/22 17:44:25 UTC
[02/15] ignite git commit: Fixed whole cluster restart test
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 <al...@gmail.com>
Authored: Mon May 22 11:18:29 2017 +0300
Committer: Alexey Goncharuk <al...@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();
+ }
}
}
}