[
https://issues.apache.org/jira/browse/GEODE-2196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15752072#comment-15752072
]
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_r92666840
--- Diff:
geode-core/src/test/java/org/apache/geode/test/dunit/rules/GfshShellConnectionRule.java
---
@@ -85,21 +91,16 @@ 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);
- }
+ return !gfsh.outputString.contains("no such object in table");
+ });
+
+ CommandResult result = (CommandResult) gfsh.getResult();
--- End diff --
the getResult call needs to be inside the awaitility loop. The result is
put in a queue everytime a command is called. If you only call it outside the
loop, the result you got is the first command result in the loop.
> 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)