ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [1/2] incubator-ignite git commit: # sprint-2 print more info in test
Date Wed, 25 Mar 2015 08:46:31 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/sprint-2 678272707 -> 2126914f7


# sprint-2 print more info in test


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

Branch: refs/heads/sprint-2
Commit: e4fa375bc48945655ecbfd1fb437510e26b941f1
Parents: 7161112
Author: sboikov <sboikov@gridgain.com>
Authored: Wed Mar 25 11:45:58 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Wed Mar 25 11:45:58 2015 +0300

----------------------------------------------------------------------
 .../GridCacheAbstractRemoveFailureTest.java     |  8 ++++--
 ...idCacheValueConsistencyAbstractSelfTest.java | 27 +++++++++++++++++---
 2 files changed, 30 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e4fa375b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
index c4881a1..c6ede61 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheAbstractRemoveFailureTest.java
@@ -299,8 +299,12 @@ public abstract class GridCacheAbstractRemoveFailureTest extends GridCacheAbstra
                     boolean primary = affinity(cache).isPrimary(ignite.cluster().localNode(),
expVal.getKey());
                     boolean backup = affinity(cache).isBackup(ignite.cluster().localNode(),
expVal.getKey());
 
-                    log.error("Unexpected cache data [exp=" + expVal + ", actual=" + val
+ ", nodePrimary=" + primary +
-                        ", nodeBackup=" + backup + ", nodeId=" + ignite.cluster().localNode().id()
+ ']');
+                    log.error("Unexpected cache data [exp=" + expVal +
+                        ", actual=" + val +
+                        ", nodePrimary=" + primary +
+                        ", nodeBackup=" + backup +
+                        ", nodeIdx" + i +
+                        ", nodeId=" + ignite.cluster().localNode().id() + ']');
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e4fa375b/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 7877f0b..4c684c4 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
@@ -19,6 +19,7 @@ package org.apache.ignite.internal.processors.cache;
 
 import org.apache.ignite.*;
 import org.apache.ignite.cache.*;
+import org.apache.ignite.cache.affinity.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
@@ -269,17 +270,35 @@ public abstract class GridCacheValueConsistencyAbstractSelfTest extends
GridCach
         int present = 0;
         int absent = 0;
 
+        Affinity<Integer> aff = ignite(0).affinity(null);
+
+        boolean invalidVal = false;
+
         for (int i = 0; i < range; i++) {
             Long firstVal = null;
 
             for (int g = 0; g < gridCount(); g++) {
-                Long val = (Long)grid(g).cache(null).localPeek(i, CachePeekMode.ONHEAP);
+                Ignite ignite = grid(g);
+
+                Long val = (Long)ignite.cache(null).localPeek(i, CachePeekMode.ONHEAP);
 
                 if (firstVal == null && val != null)
                     firstVal = val;
 
-                assert val == null || firstVal.equals(val) : "Invalid value detected [val="
+ val +
-                    ", firstVal=" + firstVal + ']';
+                if (val != null) {
+                    if (!firstVal.equals(val)) {
+                        invalidVal = true;
+
+                        boolean primary = aff.isPrimary(ignite.cluster().localNode(), i);
+                        boolean backup = aff.isBackup(ignite.cluster().localNode(), i);
+
+                        log.error("Invalid value detected [val=" + val +
+                            ", firstVal=" + firstVal +
+                            ", node=" + g +
+                            ", primary=" + primary +
+                            ", backup=" + backup + ']');
+                    }
+                }
             }
 
             if (firstVal == null)
@@ -288,6 +307,8 @@ public abstract class GridCacheValueConsistencyAbstractSelfTest extends
GridCach
                 present++;
         }
 
+        assertFalse("Inconsistent value found.", invalidVal);
+
         info("Finished check [present=" + present + ", absent=" + absent + ']');
 
         info("Checking keySet consistency");


Mime
View raw message