Skip to content

Commit

Permalink
HBASE-24656 [Flakey Tests] branch-2 TestMasterNoCluster.testStopDurin…
Browse files Browse the repository at this point in the history
…gStart (#1998)
  • Loading branch information
saintstack committed Jul 1, 2020
1 parent 5301839 commit a2dbff0
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.apache.hadoop.hbase.ServerMetricsBuilder;
import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.Waiter;
import org.apache.hadoop.hbase.ZooKeeperConnectionException;
import org.apache.hadoop.hbase.client.ClusterConnection;
import org.apache.hadoop.hbase.client.HConnectionTestingUtility;
Expand Down Expand Up @@ -118,7 +119,22 @@ public boolean isAborted() {
return false;
}
});
ZKUtil.deleteNodeRecursively(zkw, zkw.getZNodePaths().baseZNode);
// Before fails sometimes so retry.
try {
TESTUTIL.waitFor(10000, new Waiter.Predicate<Exception>() {
@Override public boolean evaluate() throws Exception {
try {
ZKUtil.deleteNodeRecursively(zkw, zkw.getZNodePaths().baseZNode);
return true;
} catch (KeeperException.NotEmptyException e) {
LOG.info("Failed delete, retrying", e);
}
return false;
}
});
} catch (Exception e) {
LOG.info("Failed zk clear", e);
}
zkw.close();
}

Expand Down

0 comments on commit a2dbff0

Please sign in to comment.