xcangCRM commented on a change in pull request #375: HBASE-21426 
TestEncryptionKeyRotation.testCFKeyRotation is flaky
URL: https://github.com/apache/hbase/pull/375#discussion_r303144866
 
 

 ##########
 File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestEncryptionKeyRotation.java
 ##########
 @@ -133,27 +135,14 @@ public void testCFKeyRotation() throws Exception {
 
     // And major compact
     TEST_UTIL.getAdmin().majorCompact(htd.getTableName());
-    final List<Path> updatePaths = 
findCompactedStorefilePaths(htd.getTableName());
-    TEST_UTIL.waitFor(30000, 1000, true, new Predicate<Exception>() {
+    // waiting for the major compaction to complete
+    TEST_UTIL.waitFor(30000, new Waiter.Predicate<IOException>() {
       @Override
-      public boolean evaluate() throws Exception {
-        // When compaction has finished, all of the original files will be
-        // gone
-        boolean found = false;
-        for (Path path: updatePaths) {
-          found = TEST_UTIL.getTestFileSystem().exists(path);
-          if (found) {
-            LOG.info("Found " + path);
-            break;
-          }
-        }
-        return !found;
+      public boolean evaluate() throws IOException {
+        return TEST_UTIL.getAdmin().getCompactionState(htd.getTableName()) ==
+            CompactionState.NONE;
 
 Review comment:
   So here you are checking table's compaction state is "NONE" to determine 
compaction is done.
   How is this sufficient? Can this state never changed? Thanks

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to