You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by gv...@apache.org on 2019/02/07 13:12:18 UTC
[ignite] branch master updated: Revert "IGNITE-10444: MVCC:
CacheMvccTxFastFinishTest fixed. This closes #6026."
This is an automated email from the ASF dual-hosted git repository.
gvvinblade pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 97500ee Revert "IGNITE-10444: MVCC: CacheMvccTxFastFinishTest fixed. This closes #6026."
97500ee is described below
commit 97500ee9eeeef37b8806bbfcba7510201a859ede
Author: Igor Seliverstov <gv...@gmail.com>
AuthorDate: Thu Feb 7 16:12:07 2019 +0300
Revert "IGNITE-10444: MVCC: CacheMvccTxFastFinishTest fixed. This closes #6026."
This reverts commit ba48c3f1
---
.../cache/CacheMvccTxFastFinishTest.java | 18 ++--------
.../processors/cache/CacheTxFastFinishTest.java | 40 ++++++----------------
2 files changed, 12 insertions(+), 46 deletions(-)
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMvccTxFastFinishTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMvccTxFastFinishTest.java
index e70b6d4..52ea882 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMvccTxFastFinishTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheMvccTxFastFinishTest.java
@@ -20,8 +20,6 @@ package org.apache.ignite.internal.processors.cache;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteTransactions;
-import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.transactions.Transaction;
import org.junit.Ignore;
@@ -33,8 +31,6 @@ import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_REA
public class CacheMvccTxFastFinishTest extends CacheTxFastFinishTest {
/** {@inheritDoc} */
@Override protected void fastFinishTx(Ignite ignite) {
- assert MvccFeatureChecker.forcedMvcc();
-
IgniteTransactions txs = ignite.transactions();
IgniteCache<Integer, Integer> cache = ignite.cache(DEFAULT_CACHE_NAME);
@@ -48,7 +44,7 @@ public class CacheMvccTxFastFinishTest extends CacheTxFastFinishTest {
try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
cache.get(i);
- checkNormalTxFinish(tx, commit, true);
+ checkNormalTxFinish(tx, commit);
}
}
@@ -56,19 +52,9 @@ public class CacheMvccTxFastFinishTest extends CacheTxFastFinishTest {
try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
cache.put(i, i);
- checkNormalTxFinish(tx, commit, false);
+ checkNormalTxFinish(tx, commit);
}
}
}
}
-
- /** {@inheritDoc} */
- @Override protected void checkNormalCommittedTx(IgniteInternalTx tx, boolean readOnly) {
- if (readOnly)
- assertNull(prepareFuture(tx));
- else
- assertNotNull(prepareFuture(tx));
-
- assertNotNull(finishFuture(tx));
- }
}
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheTxFastFinishTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheTxFastFinishTest.java
index 85e0991..94d272d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheTxFastFinishTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheTxFastFinishTest.java
@@ -28,7 +28,6 @@ import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxFa
import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
import org.apache.ignite.internal.processors.cache.transactions.TransactionProxyImpl;
import org.apache.ignite.testframework.GridTestUtils;
-import org.apache.ignite.testframework.MvccFeatureChecker;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.apache.ignite.transactions.Transaction;
import org.apache.ignite.transactions.TransactionConcurrency;
@@ -38,7 +37,6 @@ import org.junit.Test;
import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;
import static org.apache.ignite.cache.CacheMode.PARTITIONED;
import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC;
-import static org.apache.ignite.testframework.MvccFeatureChecker.Feature.NEAR_CACHE;
import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC;
import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
import static org.apache.ignite.transactions.TransactionIsolation.READ_COMMITTED;
@@ -88,8 +86,6 @@ public class CacheTxFastFinishTest extends GridCommonAbstractTest {
*/
@Test
public void testFastFinishTxNearCache() throws Exception {
- MvccFeatureChecker.skipIfNotSupported(NEAR_CACHE);
-
nearCache = true;
fastFinishTx();
@@ -173,13 +169,13 @@ public class CacheTxFastFinishTest extends GridCommonAbstractTest {
try (Transaction tx = txs.txStart(OPTIMISTIC, SERIALIZABLE)) {
cache.get(i);
- checkNormalTxFinish(tx, commit, true);
+ checkNormalTxFinish(tx, commit);
}
try (Transaction tx = txs.txStart(PESSIMISTIC, REPEATABLE_READ)) {
cache.get(i);
- checkNormalTxFinish(tx, commit, true);
+ checkNormalTxFinish(tx, commit);
}
}
@@ -189,7 +185,7 @@ public class CacheTxFastFinishTest extends GridCommonAbstractTest {
try (Transaction tx = txs.txStart(c, isolation)) {
cache.put(i, i);
- checkNormalTxFinish(tx, commit, false);
+ checkNormalTxFinish(tx, commit);
}
}
}
@@ -209,47 +205,31 @@ public class CacheTxFastFinishTest extends GridCommonAbstractTest {
IgniteInternalTx tx0 = ((TransactionProxyImpl)tx).tx();
- assertNull(prepareFuture(tx0));
- assertTrue(finishFuture(tx0) instanceof GridNearTxFastFinishFuture);
+ assertNull(fieldValue(tx0, "prepFut"));
+ assertTrue(fieldValue(tx0, "finishFut") instanceof GridNearTxFastFinishFuture);
}
/**
* @param tx Transaction.
* @param commit Commit flag.
- * @param readOnly {@code true} if checked tx did no writes.
*/
- protected void checkNormalTxFinish(Transaction tx, boolean commit, boolean readOnly) {
+ protected void checkNormalTxFinish(Transaction tx, boolean commit) {
IgniteInternalTx tx0 = ((TransactionProxyImpl)tx).tx();
if (commit) {
tx.commit();
- checkNormalCommittedTx(tx0, readOnly);
+ assertNotNull(fieldValue(tx0, "prepFut"));
+ assertNotNull(fieldValue(tx0, "finishFut"));
}
else {
tx.rollback();
- assertNull(prepareFuture(tx0));
- assertNotNull(finishFuture(tx0));
+ assertNull(fieldValue(tx0, "prepFut"));
+ assertNotNull(fieldValue(tx0, "finishFut"));
}
}
- /** */
- protected void checkNormalCommittedTx(IgniteInternalTx tx, boolean readOnly) {
- assertNotNull(prepareFuture(tx));
- assertNotNull(finishFuture(tx));
- }
-
- /** */
- protected Object prepareFuture(IgniteInternalTx tx) {
- return fieldValue(tx, "prepFut");
- }
-
- /** */
- protected Object finishFuture(IgniteInternalTx tx) {
- return fieldValue(tx, "finishFut");
- }
-
/**
* @param obj Obejct.
* @param fieldName Field name.