geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jensde...@apache.org
Subject [17/33] incubator-geode git commit: fixing a test hook for a QueryMonitor unit test
Date Wed, 30 Dec 2015 00:28:17 GMT
fixing a test hook for a QueryMonitor unit test

The affected test will be moved to open-source in the up-coming
migration of the continuous-query project to open-source.  The
test hook wasn't quite robust enough and allowed a query that was
canceled to appear, to the test at least, as if it had not been
canceled.


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

Branch: refs/heads/feature/GEODE-14
Commit: 4630e2ef4cd74c605c76a170a8c21173a919fef4
Parents: adacdd7
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Mon Dec 21 12:18:10 2015 -0800
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Mon Dec 21 12:19:33 2015 -0800

----------------------------------------------------------------------
 .../gemstone/gemfire/cache/query/internal/QueryMonitor.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4630e2ef/gemfire-core/src/main/java/com/gemstone/gemfire/cache/query/internal/QueryMonitor.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/query/internal/QueryMonitor.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/query/internal/QueryMonitor.java
index 049b9ab..65a64a4 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/query/internal/QueryMonitor.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/query/internal/QueryMonitor.java
@@ -153,6 +153,12 @@ public class QueryMonitor implements Runnable {
             testException = new QueryExecutionTimeoutException("The Query completed sucessfully
before it got canceled.");          
           }
         }
+        
+        if ((testException == null) && (query instanceof DefaultQuery)) {
+          if (((DefaultQuery)query).isCanceled()) {
+            testException = new QueryExecutionTimeoutException("The query task could not
be found but the query is marked as having been canceled");
+          }
+        }
       }
       // END - DUnit Test purpose.
 
@@ -162,7 +168,7 @@ public class QueryMonitor implements Runnable {
     }
     
     if (logger.isDebugEnabled()) {
-      logger.debug("Removed thread from QueryMonitor. QueryMonitor size is:{}, Thread (id):
thread is : {}", 
+      logger.debug("Removed thread from QueryMonitor. QueryMonitor size is:{}, Thread ID
is: {}  thread is : {}", 
           queryThreads.size(), queryThread.getId(), queryThread);
     }
     


Mime
View raw message