IGNITE-10778: MVCC: Invoke request may hang sometimes. This closes #5740.
authorrkondakov <kondakov87@mail.ru>
Fri, 11 Jan 2019 13:49:41 +0000 (16:49 +0300)
committerIgor Seliverstov <gvvinblade@gmail.com>
Fri, 11 Jan 2019 13:50:11 +0000 (16:50 +0300)
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheMultinodeUpdateAbstractSelfTest.java

index d9b172a..cac727b 100644 (file)
@@ -26,12 +26,10 @@ import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.CacheMode;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.JUnit4;
 
-import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
 import static org.apache.ignite.cache.CacheMode.PARTITIONED;
 import static org.apache.ignite.testframework.MvccFeatureChecker.assertMvccWriteConflict;
 
@@ -82,9 +80,6 @@ public abstract class GridCacheMultinodeUpdateAbstractSelfTest extends GridCache
      */
     @Test
     public void testInvoke() throws Exception {
-        if (MvccFeatureChecker.forcedMvcc())
-            fail("https://issues.apache.org/jira/browse/IGNITE-10778");
-
         IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
 
         final Integer key = primaryKey(cache);
@@ -96,8 +91,12 @@ public abstract class GridCacheMultinodeUpdateAbstractSelfTest extends GridCache
 
         Integer expVal = 0;
 
-        for (int i = 0; i < iterations(); i++) {
-            log.info("Iteration: " + i);
+        final long endTime = System.currentTimeMillis() + GridTestUtils.SF.applyLB(60_000, 10_000);
+
+        int iter = 0;
+
+        while (System.currentTimeMillis() < endTime) {
+            log.info("Iteration: " + iter++);
 
             final AtomicInteger gridIdx = new AtomicInteger();
 
@@ -139,13 +138,6 @@ public abstract class GridCacheMultinodeUpdateAbstractSelfTest extends GridCache
     }
 
     /**
-     * @return Number of iterations.
-     */
-    protected int iterations() {
-        return atomicityMode() == ATOMIC ? 30 : 15;
-    }
-
-    /**
      *
      */
     protected static class IncProcessor implements EntryProcessor<Integer, Integer, Void>, Serializable {