Repository: ignite
Updated Branches:
  refs/heads/ignite-7573 [created] 4724a5f9d


IGNITE-7573 Fixed test


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

Branch: refs/heads/ignite-7573
Commit: 4724a5f9d00a3a752cb3ae6e8c5eda5d3b4f9722
Parents: 394019e
Author: Alexey Goncharuk <[email protected]>
Authored: Tue Jan 30 22:13:26 2018 +0300
Committer: Alexey Goncharuk <[email protected]>
Committed: Tue Jan 30 22:13:26 2018 +0300

----------------------------------------------------------------------
 .../cache/GridCacheAbstractFullApiSelfTest.java          | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/4724a5f9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
index e6c9589..2e6a19c 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractFullApiSelfTest.java
@@ -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));

Reply via email to