[GitHub] [hbase] infraio commented on a change in pull request #1181: HBASE-23862 Fix flaky TestSnapshotFromMaster in 1.x versions
infraio commented on a change in pull request #1181: HBASE-23862 Fix flaky TestSnapshotFromMaster in 1.x versions URL: https://github.com/apache/hbase/pull/1181#discussion_r381655838 ## File path: hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java ## @@ -530,8 +530,11 @@ public boolean evaluate() throws Exception { return UTIL.getHBaseAdmin().listSnapshots(Pattern.compile(snapshotName)).size() == 1; } }); -assertTrue(master.getSnapshotManager().isTakingAnySnapshot()); -Thread.sleep(11 * 1000L); -assertFalse(master.getSnapshotManager().isTakingAnySnapshot()); +UTIL.waitFor(3, new Predicate() { + @Override + public boolean evaluate() throws Exception { +return master.getSnapshotManager().isTakingAnySnapshot(); Review comment: Should add a "!" here? It is assertFalse before. 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
[GitHub] [hbase] infraio commented on a change in pull request #1181: HBASE-23862 Fix flaky TestSnapshotFromMaster in 1.x versions
infraio commented on a change in pull request #1181: HBASE-23862 Fix flaky TestSnapshotFromMaster in 1.x versions URL: https://github.com/apache/hbase/pull/1181#discussion_r380489633 ## File path: hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java ## @@ -530,8 +530,11 @@ public boolean evaluate() throws Exception { return UTIL.getHBaseAdmin().listSnapshots(Pattern.compile(snapshotName)).size() == 1; } }); -assertTrue(master.getSnapshotManager().isTakingAnySnapshot()); -Thread.sleep(11 * 1000L); -assertFalse(master.getSnapshotManager().isTakingAnySnapshot()); +UTIL.waitFor(3, new Predicate() { + @Override + public boolean evaluate() throws Exception { +return UTIL.getHBaseAdmin().listSnapshots(Pattern.compile(snapshotName)).size() == 1; Review comment: UTIL.waitFor(3, () -> !master.getSnapshotManager().isTakingAnySnapshot());? 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