[ 
https://issues.apache.org/jira/browse/GEODE-2196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15750398#comment-15750398
 ] 

ASF GitHub Bot commented on GEODE-2196:
---------------------------------------

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. 
    



> Write more tests to cover the current behavior of cluster config
> ----------------------------------------------------------------
>
>                 Key: GEODE-2196
>                 URL: https://issues.apache.org/jira/browse/GEODE-2196
>             Project: Geode
>          Issue Type: Sub-task
>          Components: management
>            Reporter: Jinmei Liao
>            Assignee: Mark Bretl
>             Fix For: 1.1.0
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to