You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/04/11 22:17:06 UTC

[GitHub] [accumulo] milleruntime commented on a change in pull request #1082: Improve FateConcurrencyIT to reduce transient test errors (Issue #1079).

milleruntime commented on a change in pull request #1082: Improve FateConcurrencyIT to reduce transient test errors (Issue #1079).
URL: https://github.com/apache/accumulo/pull/1082#discussion_r274680253
 
 

 ##########
 File path: test/src/main/java/org/apache/accumulo/test/functional/FateConcurrencyIT.java
 ##########
 @@ -322,25 +352,38 @@ public void getFateStatus() {
    */
   private boolean blockUntilCompactionRunning(final String tableName) {
 
-    int runningCompactions = 0;
+    long maxWait = defaultTimeoutSeconds() <= 0 ? 60_000 : ((defaultTimeoutSeconds() * 1000) / 2);
+
+    long startWait = System.currentTimeMillis();
 
     List<String> tservers = connector.instanceOperations().getTabletServers();
 
     /*
-     * wait for compaction to start - The compaction will acquire a fate transaction lock that used
-     * to block a subsequent online command while the fate transaction lock was held.
+     * wait for compaction to start on table - The compaction will acquire a fate transaction lock
+     * that used to block a subsequent online command while the fate transaction lock was held.
      */
-    while (runningCompactions == 0) {
+    while (System.currentTimeMillis() < (startWait + maxWait)) {
 
       try {
 
+        int runningCompactions = 0;
+
         for (String tserver : tservers) {
           runningCompactions += connector.instanceOperations().getActiveCompactions(tserver).size();
           log.trace("tserver {}, running compactions {}", tservers, runningCompactions);
         }
 
+        if (runningCompactions > 0) {
+          // Validate that there is a compaction fate transaction - otherwise test is invalid.
+          if (findFate(tableName)) {
+            return true;
+          }
+        }
+
       } catch (AccumuloSecurityException | AccumuloException ex) {
         throw new IllegalStateException("failed to get active compactions, test fails.", ex);
+      } catch (KeeperException ex) {
+        log.trace("Saw possible transient zookeeper error");
 
 Review comment:
   Since this is a Test, I would make this at least error.  This seems very useful to know. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services