keith-turner commented on code in PR #6214:
URL: https://github.com/apache/accumulo/pull/6214#discussion_r2927931050
##########
test/src/main/java/org/apache/accumulo/test/MultipleManagerStartupWaitIT.java:
##########
@@ -74,34 +68,46 @@ public void testManagerWait() throws Exception {
});
clusterThread.start();
- // Wait a few seconds for processes to start and
- // for ServerContext to be created
- Thread.sleep(10_000);
+ // Wait a few seconds for processes to start
+ // ServiceLock is set during start after starting
+ // the processes and before verifyUp is called.-
+ Wait.waitFor(() -> getCluster() != null);
+ Wait.waitFor(() -> getCluster().getServerContext() != null);
+ Wait.waitFor(() -> getCluster().getServerContext().getServiceLock() !=
null);
// One Manager should be up and have acquired the assistant manager lock
- Wait.waitFor(() -> getAssistantManagers().size() == 1);
+ Wait.waitFor(() -> getCluster().getServerContext().getServerPaths()
+ .getAssistantManagers(AddressSelector.all(), true).size() == 1);
// The Primary Manager lock should not be acquired yet
assertNull(getCluster().getServerContext().getServerPaths().getManager(true));
// Start the 2nd Manager
getCluster().getConfig().getClusterServerConfiguration().setNumManagers(2);
- getCluster().start();
+ // Don't call Cluster.start, it's synchronized and the thread
Review Comment:
This comment helped me understand why setup is called in a background
thread. Would setUp() block forever if min managers was set to 2?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]