|
@@ -321,18 +321,14 @@ public class QuorumTest extends ZKTestCase {
|
|
"127.0.0.1:" + qu.getPeer(2).clientPort,
|
|
"127.0.0.1:" + qu.getPeer(2).clientPort,
|
|
CONNECTION_TIMEOUT));
|
|
CONNECTION_TIMEOUT));
|
|
|
|
|
|
- boolean success = false;
|
|
|
|
for (int i = 0; i < 30; i++) {
|
|
for (int i = 0; i < 30; i++) {
|
|
try {
|
|
try {
|
|
zk.create("/test", "test".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
|
|
zk.create("/test", "test".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
|
|
CreateMode.PERSISTENT);
|
|
CreateMode.PERSISTENT);
|
|
- success = true;
|
|
|
|
break;
|
|
break;
|
|
} catch(KeeperException.ConnectionLossException e) {
|
|
} catch(KeeperException.ConnectionLossException e) {
|
|
Thread.sleep(1000);
|
|
Thread.sleep(1000);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- if (!success) {
|
|
|
|
// test fails if we still can't connect to the quorum after 30 seconds.
|
|
// test fails if we still can't connect to the quorum after 30 seconds.
|
|
Assert.fail("client could not connect to reestablished quorum: giving up after 30+ seconds.");
|
|
Assert.fail("client could not connect to reestablished quorum: giving up after 30+ seconds.");
|
|
}
|
|
}
|