Github user jinmeiliao commented on a diff in the pull request:

    https://github.com/apache/geode/pull/317#discussion_r92544410
  
    --- Diff: 
geode-core/src/test/java/org/apache/geode/test/dunit/rules/GfshShellConnectionRule.java
 ---
    @@ -85,19 +91,17 @@ public void connect(String... options) throws Exception 
{
         // javax.naming.CommunicationException [Root exception is 
java.rmi.NoSuchObjectException: no
         // such object in table]" Exception.
         // Tried to wait on jmx connector server being ready, but it doesn't 
work.
    -    // Add the retry logic here to try at most 10 times for connection.
    -    CommandResult result = null;
    -    for (int i = 0; i < 50; i++) {
    -      System.out.println("trying to connect, attempt " + i);
    +    Awaitility.await().atMost(2, TimeUnit.MINUTES).pollDelay(2, 
TimeUnit.SECONDS).until(() -> {
           gfsh.executeCommand(connectCommand.toString());
    -      result = (CommandResult) gfsh.getResult();
    -      System.out.println(gfsh.outputString);
    -      if (!gfsh.outputString.contains("no such object in table")) {
    -        break;
    -      }
    -      Thread.currentThread().sleep(2000);
    -    }
    -    connected = (result.getStatus() == Result.Status.OK);
    +      CommandResult result = (CommandResult) gfsh.getResult();
    +      return !gfsh.outputString.contains("no such object in table")
    --- End diff --
    
    We only want to retry connecting when we get "no such object in table" 
message. This would wait for 2 minutes even if the JMX connector is ready but 
the connection failed due to some other reason like invalid username/password 
etc. 
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to