Permalink
Browse files

use retryZookeeper in AclAwareZookeeperTest to improve test stability

RB=1325295
G=si-core-reviewers
R=cxu,fcapponi
A=fcapponi
  • Loading branch information...
alexjinghn committed May 31, 2018
1 parent 555bed8 commit a9ac175ecb4c0bd2c5895d5360bee2f5e8dd2ba9
@@ -22,6 +22,8 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.WatchedEvent;
@@ -40,6 +42,7 @@
{
private final int ZK_PORT = 2120;
private final int ZK_TIMEOUT = 2000;
private final int ZK_RETRY_LIMIT = 10;
private ZKServer _zkServer;
private ZooKeeper _verificationZKClient;
@@ -65,7 +68,8 @@ private ZooKeeper getAclAwareZookeeper(List<ACL> providedAcls, byte[] authInfo,
aclProvider.setAuthScheme(scheme);
aclProvider.setAuthInfo(authInfo);
ZooKeeper newSession = new VanillaZooKeeperAdapter("localhost:" + ZK_PORT, ZK_TIMEOUT, new TestWatcher());
ZooKeeper aclAwareZk = new AclAwareZookeeper(newSession, aclProvider);
ZooKeeper retryZk = new RetryZooKeeper(newSession, ZK_RETRY_LIMIT);
ZooKeeper aclAwareZk = new AclAwareZookeeper(retryZk, aclProvider);
return aclAwareZk;
}

0 comments on commit a9ac175

Please sign in to comment.