提交 f8f747f2 编写于 作者: S Stephan Ewen

[FLINK-3268] [tests] Enhance stability of ZooKeeperTestEnvironment.deleteAll()

上级 7378f014
......@@ -137,7 +137,19 @@ public class ZooKeeperTestEnvironment {
*/
public void deleteAll() throws Exception {
final String path = "/" + client.getNamespace();
ZKPaths.deleteChildren(client.getZookeeperClient().getZooKeeper(), path, false);
for (int attempt = 0; attempt < 3; attempt++) {
try {
ZKPaths.deleteChildren(client.getZookeeperClient().getZooKeeper(), path, false);
break;
}
catch (org.apache.zookeeper.KeeperException.NoNodeException e) {
// that seems all right. if one of the children we want to delete is
// actually already deleted, that's fine.
// still, fall through the loop to delete the other children
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册