ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpav...@apache.org
Subject [38/50] [abbrv] ignite git commit: IGNITE-6075 Fix for CacheLoadingConcurrentGridStartSelfTest sometimes fails - Fixes #3829.
Date Thu, 24 May 2018 12:52:01 GMT
IGNITE-6075 Fix for CacheLoadingConcurrentGridStartSelfTest sometimes fails - Fixes #3829.

Signed-off-by: dpavlov <dpavlov@apache.org>


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

Branch: refs/heads/ignite-5789-1
Commit: cc5484a998b696dceb6817263212f8a1da791ba3
Parents: d52bfdb
Author: Fedotov <vanen31@gmail.com>
Authored: Tue May 22 18:04:25 2018 +0300
Committer: dpavlov <dpavlov@apache.org>
Committed: Tue May 22 18:04:25 2018 +0300

----------------------------------------------------------------------
 ...CacheLoadingConcurrentGridStartSelfTest.java | 22 ++++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/cc5484a9/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
index ebc804f..cbd0124 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheLoadingConcurrentGridStartSelfTest.java
@@ -38,6 +38,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.IgniteEx;
 import org.apache.ignite.internal.IgniteInternalFuture;
+import org.apache.ignite.internal.processors.datastreamer.DataStreamerImpl;
 import org.apache.ignite.internal.util.lang.GridAbsPredicate;
 import org.apache.ignite.internal.util.typedef.G;
 import org.apache.ignite.internal.util.typedef.P1;
@@ -276,6 +277,8 @@ public class CacheLoadingConcurrentGridStartSelfTest extends GridCommonAbstractT
                 try (IgniteDataStreamer<Integer, String> dataStreamer = grid.dataStreamer(DEFAULT_CACHE_NAME))
{
                     dataStreamer.allowOverwrite(allowOverwrite);
 
+                    ((DataStreamerImpl)dataStreamer).maxRemapCount(Integer.MAX_VALUE);
+
                     for (int i = 0; i < KEYS_CNT; i++) {
                         set.add(dataStreamer.addData(i, "Data"));
 
@@ -367,25 +370,26 @@ public class CacheLoadingConcurrentGridStartSelfTest extends GridCommonAbstractT
     private void assertCacheSize() throws Exception {
         final IgniteCache<Integer, String> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
-        GridTestUtils.waitForCondition(new GridAbsPredicate() {
+        boolean consistentCache = GridTestUtils.waitForCondition(new GridAbsPredicate() {
             @Override public boolean apply() {
                 int size = cache.size(CachePeekMode.PRIMARY);
 
                 if (size != KEYS_CNT)
                     log.info("Cache size: " + size);
 
-                return size == KEYS_CNT;
-            }
-        }, 2 * 60_000);
+                int total = 0;
 
-        assertEquals("Data lost.", KEYS_CNT, cache.size(CachePeekMode.PRIMARY));
+                for (int i = 0; i < GRIDS_CNT; i++)
+                    total += grid(i).cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.PRIMARY);
 
-        int total = 0;
+                if (total != KEYS_CNT)
+                    log.info("Total size: " + size);
 
-        for (int i = 0; i < GRIDS_CNT; i++)
-            total += grid(i).cache(DEFAULT_CACHE_NAME).localSize(CachePeekMode.PRIMARY);
+                return size == KEYS_CNT && KEYS_CNT == total;
+            }
+        }, 2 * 60_000);
 
-        assertEquals("Data lost.", KEYS_CNT, total);
+        assertTrue("Data lost. Actual cache size: " + cache.size(CachePeekMode.PRIMARY),
consistentCache);
     }
 
     /**


Mime
View raw message