ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [2/6] incubator-ignite git commit: # sprint-2 Changed test to increase failure possibility
Date Fri, 27 Mar 2015 10:09:28 GMT
# sprint-2 Changed test to increase failure possibility


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

Branch: refs/heads/sprint-3
Commit: 64c67e6e19a69fe0d999884f068262f6de0b90a5
Parents: f860b80
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Mar 27 10:47:09 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Mar 27 10:53:47 2015 +0300

----------------------------------------------------------------------
 ...idCacheValueConsistencyAbstractSelfTest.java | 42 +++++++++++++++++++-
 ...heValueConsistencyTransactionalSelfTest.java |  2 +-
 ...sistencyAtomicPrimaryWriteOrderSelfTest.java | 32 +++++++++++++++
 ...GridCacheValueConsistencyAtomicSelfTest.java |  2 +-
 .../ignite/testsuites/IgniteCacheTestSuite.java |  1 +
 5 files changed, 75 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/64c67e6e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyAbstractSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyAbstractSelfTest.java
index 7875402..ba38496 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyAbstractSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyAbstractSelfTest.java
@@ -51,7 +51,7 @@ public abstract class GridCacheValueConsistencyAbstractSelfTest extends
GridCach
 
     /** {@inheritDoc} */
     @Override protected long getTestTimeout() {
-        return 60000;
+        return 5 * 60_000;
     }
 
     /** {@inheritDoc} */
@@ -228,7 +228,18 @@ public abstract class GridCacheValueConsistencyAbstractSelfTest extends
GridCach
      * @throws Exception If failed.
      */
     public void testPutRemoveConsistencyMultithreaded() throws Exception {
-        final int range = 10000;
+       for (int i = 0; i < 10; i++) {
+           log.info("Iteration: " + i);
+
+           putRemoveConsistencyMultithreaded();
+       }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    private void putRemoveConsistencyMultithreaded() throws Exception {
+        final int range = 10_000;
 
         final int iterCnt = iterationCount();
 
@@ -298,6 +309,12 @@ public abstract class GridCacheValueConsistencyAbstractSelfTest extends
GridCach
                             ", node=" + g +
                             ", primary=" + primary +
                             ", backup=" + backup + ']');
+
+                        log.error("All values: ");
+
+                        printValues(aff, i);
+
+                        break;
                     }
                 }
             }
@@ -319,6 +336,27 @@ public abstract class GridCacheValueConsistencyAbstractSelfTest extends
GridCach
     }
 
     /**
+     * @param aff Affinity.
+     * @param key Key.
+     */
+    private void printValues(Affinity<Integer> aff, int key) {
+        for (int g = 0; g < gridCount(); g++) {
+            Ignite ignite = grid(g);
+
+            boolean primary = aff.isPrimary(ignite.cluster().localNode(), key);
+            boolean backup = aff.isBackup(ignite.cluster().localNode(), key);
+
+            Object val = ignite.cache(null).localPeek(key, CachePeekMode.ONHEAP);
+
+            log.error("Node value [key=" + key +
+                ", val=" + val +
+                ", node=" + g +
+                ", primary=" + primary +
+                ", backup=" + backup + ']');
+        }
+    }
+
+    /**
      * @param g Grid to check.
      */
     private void checkKeySet(Ignite g) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/64c67e6e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalSelfTest.java
index bc9a4f0..17896f5 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheValueConsistencyTransactionalSelfTest.java
@@ -32,6 +32,6 @@ public class GridCacheValueConsistencyTransactionalSelfTest extends GridCacheVal
 
     /** {@inheritDoc} */
     @Override protected int iterationCount() {
-        return 100_000;
+        return 50_000;
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/64c67e6e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheValueConsistencyAtomicPrimaryWriteOrderSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheValueConsistencyAtomicPrimaryWriteOrderSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheValueConsistencyAtomicPrimaryWriteOrderSelfTest.java
new file mode 100644
index 0000000..cca6e8f
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheValueConsistencyAtomicPrimaryWriteOrderSelfTest.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.distributed.dht.atomic;
+
+import org.apache.ignite.cache.*;
+
+import static org.apache.ignite.cache.CacheAtomicWriteOrderMode.*;
+
+/**
+ *
+ */
+public class GridCacheValueConsistencyAtomicPrimaryWriteOrderSelfTest extends GridCacheValueConsistencyAtomicSelfTest
{
+    /** {@inheritDoc} */
+    @Override protected CacheAtomicWriteOrderMode writeOrderMode() {
+        return PRIMARY;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/64c67e6e/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheValueConsistencyAtomicSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheValueConsistencyAtomicSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheValueConsistencyAtomicSelfTest.java
index f5d09a0..ee60143 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheValueConsistencyAtomicSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/atomic/GridCacheValueConsistencyAtomicSelfTest.java
@@ -42,7 +42,7 @@ public class GridCacheValueConsistencyAtomicSelfTest extends GridCacheValueConsi
 
     /** {@inheritDoc} */
     @Override protected int iterationCount() {
-        return 400_000;
+        return 100_000;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/64c67e6e/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
index 9a85e8d..8cf9d2b 100644
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteCacheTestSuite.java
@@ -252,6 +252,7 @@ public class IgniteCacheTestSuite extends TestSuite {
 
         // Value consistency tests.
         suite.addTestSuite(GridCacheValueConsistencyAtomicSelfTest.class);
+        suite.addTestSuite(GridCacheValueConsistencyAtomicPrimaryWriteOrderSelfTest.class);
         suite.addTestSuite(GridCacheValueConsistencyAtomicNearEnabledSelfTest.class);
         suite.addTestSuite(GridCacheValueConsistencyAtomicPrimaryWriteOrderNearEnabledSelfTest.class);
         suite.addTestSuite(GridCacheValueConsistencyTransactionalSelfTest.class);


Mime
View raw message