sijie commented on a change in pull request #775: Tests wait for client to see
started bookie
URL: https://github.com/apache/bookkeeper/pull/775#discussion_r153584188
##########
File path:
bookkeeper-server/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java
##########
@@ -558,26 +559,16 @@ public int startNewBookie()
protected BookieServer startBookie(ServerConfiguration conf)
throws Exception {
BookieServer server = new BookieServer(conf);
- server.start();
-
+ BookieSocketAddress address = Bookie.getBookieAddress(conf);
if (bkc == null) {
bkc = new BookKeeperTestClient(baseClientConf);
}
+ Future<?> waitForBookie = bkc.waitForBookie(address);
- int port = conf.getBookiePort();
- String host = InetAddress.getLocalHost().getHostAddress();
- if (conf.getUseHostNameAsBookieID()) {
- host = InetAddress.getLocalHost().getCanonicalHostName();
- }
-
- while (conf.isForceReadOnlyBookie()
- && bkc.getZkHandle().exists(conf.getZkLedgersRootPath()
+"/available/readonly/" + host + ":" + port,
- false) == null) {
- Thread.sleep(100);
- }
+ server.start();
- bkc.readBookiesBlocking();
- LOG.info("New bookie on port " + port + " has been created.");
+ waitForBookie.get(30, TimeUnit.SECONDS);
+ LOG.info("New bookie, {}, has been created.", address);
Review comment:
nit: "New bookie '{}' has been created."
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services