IGNITE-7573 Fixed full API tests to be compliant with baseline topology
authorAlexey Goncharuk <alexey.goncharuk@gmail.com>
Wed, 31 Jan 2018 13:52:24 +0000 (16:52 +0300)
committerAlexey Goncharuk <alexey.goncharuk@gmail.com>
Wed, 31 Jan 2018 13:52:24 +0000 (16:52 +0300)
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/baseline/IgniteBaselineAbstractFullApiSelfTest.java

index e6c9589..2e6a19c 100644 (file)
@@ -463,14 +463,11 @@ public abstract class GridCacheAbstractFullApiSelfTest extends GridCacheAbstract
         for (int i = 0; i < gridCount(); i++)
             assertEquals(globalPrimarySize, jcache(i).size(PRIMARY));
 
-        int times = 1;
+        // Check how many instances of any given key there is in the cluster.
+        int globalSize = 0;
 
-        if (cacheMode() == REPLICATED)
-            times = gridCount();
-        else if (cacheMode() == PARTITIONED)
-            times = Math.min(gridCount(), jcache().getConfiguration(CacheConfiguration.class).getBackups() + 1);
-
-        int globalSize = globalPrimarySize * times;
+        for (String key : map.keySet())
+            globalSize += affinity(jcache()).mapKeyToPrimaryAndBackups(key).size();
 
         for (int i = 0; i < gridCount(); i++)
             assertEquals(globalSize, jcache(i).size(ALL));
index 8dcfc0b..d78c289 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache.persistence.baseline;
 import org.apache.ignite.configuration.DataRegionConfiguration;
 import org.apache.ignite.configuration.DataStorageConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.WALMode;
 import org.apache.ignite.internal.processors.cache.GridCacheAbstractFullApiSelfTest;
 
 /**
@@ -33,7 +34,8 @@ public abstract class IgniteBaselineAbstractFullApiSelfTest extends GridCacheAbs
             .setDefaultDataRegionConfiguration(
                 new DataRegionConfiguration()
                     .setMaxSize(200 * 1024 * 1024)
-                    .setPersistenceEnabled(true)));
+                    .setPersistenceEnabled(true))
+            .setWalMode(WALMode.LOG_ONLY));
 
         return cfg;
     }