ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [27/38] incubator-ignite git commit: # ignite-426 add tests
Date Mon, 17 Aug 2015 06:36:44 GMT
# ignite-426 add tests


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

Branch: refs/heads/ignite-426
Commit: ebd576c081ebfec82089a4489990994d423876e6
Parents: daa9098
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Aug 13 16:45:27 2015 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Aug 13 16:45:27 2015 +0300

----------------------------------------------------------------------
 ...acheContinuousQueryFailoverAbstractTest.java | 29 ++++++++++++++++++--
 1 file changed, 26 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/ebd576c0/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractTest.java
index e3ad025..e6f3bd7 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryFailoverAbstractTest.java
@@ -26,6 +26,7 @@ import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.managers.communication.*;
 import org.apache.ignite.internal.processors.continuous.*;
+import org.apache.ignite.internal.util.*;
 import org.apache.ignite.internal.util.lang.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.plugin.extensions.communication.*;
@@ -213,8 +214,15 @@ public abstract class CacheContinuousQueryFailoverAbstractTest extends
GridCommo
 
             stopGrid(i);
 
-            if (!latch.await(5, SECONDS))
+            if (!latch.await(5, SECONDS)) {
+                Set<Integer> keys0 = new HashSet<>(keys);
+
+                keys0.removeAll(lsnr.keys);
+
+                log.info("Missed events for keys: " + keys0);
+
                 fail("Failed to wait for notifications [exp=" + keys.size() + ", left=" +
lsnr.latch.getCount() + ']');
+            }
         }
 
         for (int i = 0; i < SRV_NODES - 1; i++) {
@@ -236,8 +244,15 @@ public abstract class CacheContinuousQueryFailoverAbstractTest extends
GridCommo
                 cache.put(key, key);
             }
 
-            if (!latch.await(5, SECONDS))
+            if (!latch.await(5, SECONDS)) {
+                Set<Integer> keys0 = new HashSet<>(keys);
+
+                keys0.removeAll(lsnr.keys);
+
+                log.info("Missed events for keys: " + keys0);
+
                 fail("Failed to wait for notifications [exp=" + keys.size() + ", left=" +
lsnr.latch.getCount() + ']');
+            }
         }
 
         cur.close();
@@ -628,6 +643,9 @@ public abstract class CacheContinuousQueryFailoverAbstractTest extends
GridCommo
         private volatile CountDownLatch latch;
 
         /** */
+        private GridConcurrentHashSet<Integer> keys = new GridConcurrentHashSet<>();
+
+        /** */
         @LoggerResource
         private IgniteLogger log;
 
@@ -639,13 +657,18 @@ public abstract class CacheContinuousQueryFailoverAbstractTest extends
GridCommo
 
                     log.info("Received cache event: " + evt + " " + (latch != null ? latch.getCount()
: null));
 
+                    keys.add((Integer) evt.getKey());
+
                     assertTrue(latch != null);
                     assertTrue(latch.getCount() > 0);
 
                     latch.countDown();
 
-                    if (latch.getCount() == 0)
+                    if (latch.getCount() == 0) {
                         this.latch = null;
+
+                        keys.clear();
+                    }
                 }
             }
             catch (Throwable e) {


Mime
View raw message