dlmarion commented on code in PR #6066:
URL: https://github.com/apache/accumulo/pull/6066#discussion_r2709733188


##########
test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionProgressIT.java:
##########
@@ -141,13 +141,21 @@ public void 
testCompactionDurationContinuesAfterCoordinatorStop() throws Excepti
           EnumSet.of(IteratorUtil.IteratorScope.majc));
 
       log.info("Compacting table");
+
+      // Verify no compactions are running before we start (catch any leftover 
state from other
+      // tests)
+      Map<String,TExternalCompaction> initialCompactions =
+          
getRunningCompactions(getCluster().getServerContext()).getCompactions();
+      assertTrue(initialCompactions == null || initialCompactions.isEmpty(),
+          "Expected no running compactions before starting the test");
+
       compact(client, table, 2, QUEUE1, false);
 
       // Wait until the compaction starts
       Wait.waitFor(() -> {
         Map<String,TExternalCompaction> compactions =
             
getRunningCompactions(getCluster().getServerContext()).getCompactions();
-        return compactions == null || compactions.isEmpty();
+        return compactions != null && !compactions.isEmpty();

Review Comment:
   This is a good catch. I can see how this may have originally occurred due to 
copy/paste content between test methods.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to