IGNITE-10440 Apply scale factor to tests - Fixes #5566. Signed-off-by: Dmitriy Govorukhin <dmitriy.govoruk...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a1897dfd Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a1897dfd Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a1897dfd Branch: refs/heads/ignite-601 Commit: a1897dfd1f82cb85260c1d05e778a609bf30511b Parents: 4baf115 Author: Alexey Platonov <aplaton...@gmail.com> Authored: Mon Dec 24 23:46:13 2018 +0300 Committer: Dmitriy Govorukhin <dmitriy.govoruk...@gmail.com> Committed: Mon Dec 24 23:46:13 2018 +0300 ---------------------------------------------------------------------- .../CacheSerializableTransactionsTest.java | 24 ++++++------ .../GridCacheAbstractNodeRestartSelfTest.java | 39 +++++++++++--------- .../IgniteCacheCrossCacheTxFailoverTest.java | 3 +- .../cache/mvcc/CacheMvccAbstractTest.java | 3 +- ...usQueryFactoryFilterRandomOperationTest.java | 3 +- ...acheContinuousQueryRandomOperationsTest.java | 3 +- .../zk/internal/ZookeeperDiscoverySpiTest.java | 15 ++++---- 7 files changed, 50 insertions(+), 40 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/a1897dfd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSerializableTransactionsTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSerializableTransactionsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSerializableTransactionsTest.java index 435d39e..65bce10 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSerializableTransactionsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheSerializableTransactionsTest.java @@ -438,12 +438,13 @@ public class CacheSerializableTransactionsTest extends GridCommonAbstractTest { List<Integer> keys = testKeys(cache0); + final int ITERATIONS_COUNT = SF.applyLB(100, 5); for (Integer key : keys) { log.info("Test key: " + key); Integer expVal = null; - for (int i = 0; i < 100; i++) { + for (int i = 0; i < ITERATIONS_COUNT; i++) { try (Transaction tx = txs0.txStart(OPTIMISTIC, SERIALIZABLE)) { Integer val = cache0.get(key); @@ -525,7 +526,7 @@ public class CacheSerializableTransactionsTest extends GridCommonAbstractTest { Integer expVal = null; - for (int i = 0; i < 100; i++) { + for (int i = 0; i < SF.applyLB(100, 10); i++) { try (Transaction tx = txs0.txStart(OPTIMISTIC, SERIALIZABLE)) { Integer val = cache0.get(key); @@ -2919,8 +2920,8 @@ public class CacheSerializableTransactionsTest extends GridCommonAbstractTest { ignite(0).createCache(ccfg); try { - final int ACCOUNTS = 50; - final int VAL_PER_ACCOUNT = 1000; + final int ACCOUNTS = SF.applyLB(50, 5); + final int VAL_PER_ACCOUNT = SF.applyLB(1000, 10); IgniteCache<Integer, Account> cache0 = ignite(0).cache(ccfg.getName()); @@ -3057,7 +3058,7 @@ public class CacheSerializableTransactionsTest extends GridCommonAbstractTest { }, 2, "update-thread"); try { - U.sleep(15_000); + U.sleep(SF.applyLB(15_000, 2_000)); } finally { stop.set(true); @@ -3880,7 +3881,8 @@ public class CacheSerializableTransactionsTest extends GridCommonAbstractTest { barrier.await(); - for (int i = 0; i < 1000; i++) { + final int ITERATIONS_COUNT = SF.applyLB(1000, 50); + for (int i = 0; i < ITERATIONS_COUNT; i++) { try { try (Transaction tx = txs.txStart(OPTIMISTIC, SERIALIZABLE)) { Integer val1 = cache.get(key1); @@ -4128,8 +4130,8 @@ public class CacheSerializableTransactionsTest extends GridCommonAbstractTest { try { final List<Ignite> clients = clients(); - final int ACCOUNTS = 100; - final int VAL_PER_ACCOUNT = 10_000; + final int ACCOUNTS = SF.applyLB(100, 10); + final int VAL_PER_ACCOUNT = SF.applyLB(10_000, 50); IgniteCache<Integer, Account> srvCache = srv.cache(cacheName); @@ -4138,9 +4140,9 @@ public class CacheSerializableTransactionsTest extends GridCommonAbstractTest { final AtomicInteger idx = new AtomicInteger(); - final int THREADS = 20; + final int THREADS = SF.applyLB(20, 5); - final long testTime = 30_000; + final long testTime = SF.applyLB(30_000, 5_000); final long stopTime = System.currentTimeMillis() + testTime; @@ -4491,7 +4493,7 @@ public class CacheSerializableTransactionsTest extends GridCommonAbstractTest { }, "update-thread-" + i)); } - U.sleep(60_000); + U.sleep(SF.applyLB(60_000, 5_000)); finished.set(true); http://git-wip-us.apache.org/repos/asf/ignite/blob/a1897dfd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java index 1fbc13f..0ba4088 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/GridCacheAbstractNodeRestartSelfTest.java @@ -42,6 +42,9 @@ import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; +import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; +import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; +import org.apache.ignite.testframework.GridTestUtils.SF; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.transactions.Transaction; import org.apache.ignite.transactions.TransactionConcurrency; @@ -296,7 +299,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 30000; + long duration = SF.applyLB(30_000, 3_000); checkRestartWithPut(duration, 1, 1); } @@ -313,7 +316,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 30000; + long duration = SF.applyLB(30_000, 3_000); checkRestartWithTx(duration, 1, 1, 3); } @@ -330,7 +333,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 30000; + long duration = SF.applyLB(30_000, 3_000); checkRestartWithPut(duration, 1, 1); } @@ -347,7 +350,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 30000; + long duration = SF.applyLB(30_000, 3_000); checkRestartWithTx(duration, 1, 1, 3); } @@ -364,7 +367,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 60000; + long duration = SF.applyLB(60_000, 5_000); checkRestartWithPut(duration, 2, 2); } @@ -381,7 +384,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 60000; + long duration = SF.applyLB(60_000, 5_000); checkRestartWithTx(duration, 2, 2, 3); } @@ -398,7 +401,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 60000; + long duration = SF.applyLB(60_000, 5_000); checkRestartWithPut(duration, 2, 2); } @@ -415,7 +418,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = true; - long duration = 60000; + long duration = SF.applyLB(60_000, 5_000); checkRestartWithPut(duration, 2, 2); } @@ -432,7 +435,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 60000; + long duration = SF.applyLB(60_000, 5_000); checkRestartWithTx(duration, 2, 2, 3); } @@ -449,7 +452,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = true; - long duration = 30_000; + long duration = SF.applyLB(30_000, 3_000); checkRestartWithTx(duration, 2, 2, 100); } @@ -466,7 +469,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 90000; + long duration = SF.applyLB(90_000, 6_000); checkRestartWithPut(duration, 3, 3); } @@ -483,7 +486,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 90000; + long duration = SF.applyLB(90_000, 6_000); checkRestartWithTx(duration, 3, 3, 3); } @@ -500,7 +503,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 90000; + long duration = SF.applyLB(90_000, 6_000); checkRestartWithPut(duration, 4, 4); } @@ -517,7 +520,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 90000; + long duration = SF.applyLB(90_000, 6_000); checkRestartWithTx(duration, 4, 4, 3); } @@ -534,7 +537,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 90000; + long duration = SF.applyLB(90_000, 6_000); checkRestartWithPut(duration, 5, 5); } @@ -551,7 +554,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 90000; + long duration = SF.applyLB(90_000, 6_000); checkRestartWithTx(duration, 5, 5, 3); } @@ -568,7 +571,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 90000; + long duration = SF.applyLB(90_000, 6_000); checkRestartWithTxPutAll(duration, 5, 5); } @@ -585,7 +588,7 @@ public abstract class GridCacheAbstractNodeRestartSelfTest extends GridCommonAbs rebalancMode = ASYNC; evict = false; - long duration = 90000; + long duration = SF.applyLB(90_000, 6_000); checkRestartWithTxPutAll(duration, 2, 2); } http://git-wip-us.apache.org/repos/asf/ignite/blob/a1897dfd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java index aae3e16..12514aa 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheCrossCacheTxFailoverTest.java @@ -55,6 +55,7 @@ import static org.apache.ignite.cache.CacheMode.PARTITIONED; import static org.apache.ignite.cache.CacheMode.REPLICATED; import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; import static org.apache.ignite.testframework.GridTestUtils.runMultiThreadedAsync; +import static org.apache.ignite.testframework.GridTestUtils.SF; import static org.apache.ignite.transactions.TransactionConcurrency.OPTIMISTIC; import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC; import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ; @@ -299,7 +300,7 @@ public class IgniteCacheCrossCacheTxFailoverTest extends GridCommonAbstractTest } }, 10, "tx-thread"); - long stopTime = System.currentTimeMillis() + 3 * 60_000; + long stopTime = System.currentTimeMillis() + SF.applyLB(3 * 60_000, 20_000); long topVer = ignite0.cluster().topologyVersion(); http://git-wip-us.apache.org/repos/asf/ignite/blob/a1897dfd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java index 5b2b475..343fd59 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccAbstractTest.java @@ -88,6 +88,7 @@ import org.apache.ignite.lang.IgniteInClosure; import org.apache.ignite.lang.IgnitePredicate; import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.GridTestUtils.SF; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.transactions.Transaction; import org.apache.ignite.transactions.TransactionConcurrency; @@ -122,7 +123,7 @@ public abstract class CacheMvccAbstractTest extends GridCommonAbstractTest { static final String CRD_ATTR = "testCrd"; /** */ - static final long DFLT_TEST_TIME = 30_000; + static final long DFLT_TEST_TIME = SF.applyLB(30_000, 3_000); /** */ protected static final int PAGE_SIZE = DataStorageConfiguration.DFLT_PAGE_SIZE; http://git-wip-us.apache.org/repos/asf/ignite/blob/a1897dfd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterRandomOperationTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterRandomOperationTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterRandomOperationTest.java index 7fadb3b..405bde7 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterRandomOperationTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFactoryFilterRandomOperationTest.java @@ -54,6 +54,7 @@ import org.apache.ignite.cache.query.ContinuousQuery; import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.internal.util.typedef.T2; +import org.apache.ignite.testframework.GridTestUtils.SF; import org.apache.ignite.transactions.Transaction; import org.apache.ignite.transactions.TransactionConcurrency; import org.apache.ignite.transactions.TransactionIsolation; @@ -90,7 +91,7 @@ public class CacheContinuousQueryFactoryFilterRandomOperationTest extends CacheC private static final int VALS = 10; /** */ - public static final int ITERATION_CNT = 40; + public static final int ITERATION_CNT = SF.applyLB(40, 5); /** * @throws Exception If failed. http://git-wip-us.apache.org/repos/asf/ignite/blob/a1897dfd/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java index 7be3301..64a717b 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryRandomOperationsTest.java @@ -69,6 +69,7 @@ import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteClosure; import org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.GridTestUtils.SF; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.transactions.Transaction; import org.apache.ignite.transactions.TransactionConcurrency; @@ -111,7 +112,7 @@ public class CacheContinuousQueryRandomOperationsTest extends GridCommonAbstract private static final int VALS = 10; /** */ - public static final int ITERATION_CNT = 100; + public static final int ITERATION_CNT = SF.applyLB(100, 5); /** */ private boolean client; http://git-wip-us.apache.org/repos/asf/ignite/blob/a1897dfd/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTest.java ---------------------------------------------------------------------- diff --git a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTest.java b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTest.java index b47d51e..808f1ee 100644 --- a/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTest.java +++ b/modules/zookeeper/src/test/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoverySpiTest.java @@ -129,6 +129,7 @@ import org.apache.ignite.spi.discovery.zk.ZookeeperDiscoverySpiAbstractTestSuite import org.apache.ignite.spi.discovery.zk.ZookeeperDiscoverySpiMBean; import org.apache.ignite.spi.discovery.zk.ZookeeperDiscoverySpiTestSuite2; import org.apache.ignite.testframework.GridTestUtils; +import org.apache.ignite.testframework.GridTestUtils.SF; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.apache.ignite.transactions.Transaction; import org.apache.zookeeper.KeeperException; @@ -1809,7 +1810,7 @@ public class ZookeeperDiscoverySpiTest extends GridCommonAbstractTest { long topVer = initNodes; - for (int i = 0; i < 10; i++) { + for (int i = 0; i < SF.applyLB(10, 2); i++) { info("Iteration: " + i); DiscoveryEvent[] expEvts = new DiscoveryEvent[NODES]; @@ -2118,7 +2119,7 @@ public class ZookeeperDiscoverySpiTest extends GridCommonAbstractTest { final int THREADS = 30; - for (int i = 0; i < 5; i++) { + for (int i = 0; i < SF.applyLB(5, 2); i++) { info("Iteration: " + i); startGridsMultiThreaded(SRVS, THREADS); @@ -2186,7 +2187,7 @@ public class ZookeeperDiscoverySpiTest extends GridCommonAbstractTest { if (closeClientSock) testSockNio = true; - long stopTime = System.currentTimeMillis() + 60_000; + long stopTime = System.currentTimeMillis() + SF.applyLB(60_000, 5_000); AtomicBoolean stop = new AtomicBoolean(); @@ -3054,7 +3055,7 @@ public class ZookeeperDiscoverySpiTest extends GridCommonAbstractTest { int nodeIdx = 10; - for (int i = 0; i < 10; i++) { + for (int i = 0; i < SF.applyLB(10, 2); i++) { info("Iteration: " + i); for (Ignite node : G.allGrids()) @@ -3105,7 +3106,7 @@ public class ZookeeperDiscoverySpiTest extends GridCommonAbstractTest { int nodeIdx = 15; - for (int i = 0; i < 10; i++) { + for (int i = 0; i < SF.applyLB(10, 2); i++) { info("Iteration: " + i); ZookeeperDiscoverySpi spi = null; @@ -3814,7 +3815,7 @@ public class ZookeeperDiscoverySpiTest extends GridCommonAbstractTest { startGridsMultiThreaded(srvs, clients); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < SF.applyLB(5, 2); i++) { info("Iteration: " + i); final CountDownLatch disconnectLatch = new CountDownLatch(clients); @@ -4511,7 +4512,7 @@ public class ZookeeperDiscoverySpiTest extends GridCommonAbstractTest { int nextNodeIdx = 0; int nextCacheIdx = 0; - long stopTime = System.currentTimeMillis() + 60_000; + long stopTime = System.currentTimeMillis() + SF.applyLB(60_000, 5_000); int MAX_NODES = 20; int MAX_CACHES = 10;