IGNITE-10692: MVCC: Test GridCacheDhtPreloadDelayedSelfTest fails in mvcc mode. this...
authorAndrey V. Mashenkov <andrey.mashenkov@gmail.com>
Mon, 14 Jan 2019 11:43:28 +0000 (14:43 +0300)
committerIgor Seliverstov <gvvinblade@gmail.com>
Mon, 14 Jan 2019 11:43:45 +0000 (14:43 +0300)
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCacheDhtPreloadDelayedSelfTest.java
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridPartitionedBackupLoadSelfTest.java
modules/core/src/test/java/org/apache/ignite/testframework/junits/common/GridCommonAbstractTest.java

index 2926252..f3c6276 100644 (file)
@@ -35,6 +35,7 @@ import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.events.Event;
 import org.apache.ignite.events.EventType;
 import org.apache.ignite.internal.IgniteKernal;
+import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionFullMap;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPreloader;
@@ -389,7 +390,10 @@ public class GridCacheDhtPreloadDelayedSelfTest extends GridCommonAbstractTest {
      * @return Topology.
      */
     private GridDhtPartitionTopology topology(Ignite g) {
-        return ((GridNearCacheAdapter<Integer, String>)((IgniteKernal)g).<Integer, String>internalCache(DEFAULT_CACHE_NAME)).dht().topology();
+        GridCacheAdapter<Integer, String> internalCache = ((IgniteKernal)g).internalCache(DEFAULT_CACHE_NAME);
+
+        return internalCache.isNear() ? ((GridNearCacheAdapter<Integer, String>)internalCache).dht().topology() :
+            internalCache.context().dht().topology();
     }
 
     /**
index 5d95606..2b4945b 100644 (file)
@@ -24,6 +24,7 @@ import org.apache.ignite.IgniteCache;
 import org.apache.ignite.cache.store.CacheStoreAdapter;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.testframework.MvccFeatureChecker;
 import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -75,6 +76,9 @@ public class GridPartitionedBackupLoadSelfTest extends GridCommonAbstractTest {
 
     /** {@inheritDoc} */
     @Override protected void beforeTest() throws Exception {
+        if (MvccFeatureChecker.forcedMvcc())
+            fail("https://issues.apache.org/jira/browse/IGNITE-8582");
+
         startGridsMultiThreaded(GRID_CNT);
     }
 
index 4344f15..5a55bf5 100755 (executable)
@@ -323,7 +323,9 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
      * @return DHT cache.
      */
     protected <K, V> GridDhtCacheAdapter<K, V> dht() {
-        return this.<K, V>near().dht();
+        GridCacheAdapter<K, V> internalCache = ((IgniteKernal)grid()).internalCache(DEFAULT_CACHE_NAME);
+
+        return internalCache.isNear() ? internalCache.context().near().dht() : internalCache.context().dht();
     }
 
     /**
@@ -331,7 +333,9 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
      * @return DHT cache.
      */
     protected <K, V> GridDhtCacheAdapter<K, V> dht(int idx) {
-        return this.<K, V>near(idx).dht();
+        GridCacheAdapter<K, V> internalCache = ((IgniteKernal)grid(idx)).internalCache(DEFAULT_CACHE_NAME);
+
+        return internalCache.isNear() ? internalCache.context().near().dht() : internalCache.context().dht();
     }
 
     /**
@@ -340,7 +344,9 @@ public abstract class GridCommonAbstractTest extends GridAbstractTest {
      * @return DHT cache.
      */
     protected <K, V> GridDhtCacheAdapter<K, V> dht(int idx, String cache) {
-        return this.<K, V>near(idx, cache).dht();
+        GridCacheAdapter<K, V> internalCache = ((IgniteKernal)grid(idx)).internalCache(cache);
+
+        return internalCache.isNear() ? internalCache.context().near().dht() : internalCache.context().dht();
     }
 
     /**