diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java index 52540d7c019..7b5464a7fcd 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompactionState.java @@ -167,14 +167,11 @@ public class TestCompactionState { assertEquals(CompactionState.NONE, state); } } else { - curt = System.currentTimeMillis(); - waitTime = 20000; - endt = curt + waitTime; + // Wait until the compaction is done state = admin.getCompactionState(table); while (state != CompactionState.NONE && curt < endt) { Thread.sleep(10); state = admin.getCompactionState(table); - curt = System.currentTimeMillis(); } // Now, compaction should be done. assertEquals(CompactionState.NONE, state); @@ -233,6 +230,5 @@ public class TestCompactionState { TEST_UTIL.flush(); puts.clear(); } - } - + } }