dlmarion commented on code in PR #6214:
URL: https://github.com/apache/accumulo/pull/6214#discussion_r2930668363


##########
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:
   min manager is set to `2` in configure(), but we started mini accumulo with 
the default number of managers (1). So the thread that is starting mini is 
stuck in verifyUp() waiting for the one manager that we started to grab the 
primary lock. However, the manager hasn't gotten that far in Manager.run 
because it's waiting for 2 managers.
   
   > Would setUp() block forever if min managers was set to 2?
   
   It is set to `2` at line 46 above, and will block for `5m` according to the 
property set at line 47. 



-- 
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]

Reply via email to