This is an automated email from the ASF dual-hosted git repository.
jinmeiliao pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 0bfb929 GEODE-5971: fix a flaky test on windows (#3278)
0bfb929 is described below
commit 0bfb929b7714222a89655b0b4d0e5f1f82d1e78f
Author: jinmeiliao <[email protected]>
AuthorDate: Thu Mar 7 21:28:10 2019 -0800
GEODE-5971: fix a flaky test on windows (#3278)
---
.../internal/cli/commands/DescribeClientCommandDUnitTest.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git
a/geode-cq/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DescribeClientCommandDUnitTest.java
b/geode-cq/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DescribeClientCommandDUnitTest.java
index c3d361b..e3cc28f 100644
---
a/geode-cq/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DescribeClientCommandDUnitTest.java
+++
b/geode-cq/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/DescribeClientCommandDUnitTest.java
@@ -18,8 +18,10 @@ package org.apache.geode.management.internal.cli.commands;
import static org.apache.geode.test.awaitility.GeodeAwaitility.await;
import static org.assertj.core.api.Assertions.assertThat;
+import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.stream.Collectors;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.junit.Before;
@@ -120,7 +122,11 @@ public class DescribeClientCommandDUnitTest {
.statusIsSuccess()
.hasTableSection()
.hasRowSize(3).getActual();
- String server1Id = listMemberTable.getValue("Id", 1);
+
+ // get the list of server ids (member ids without the locator id)
+ List<String> serverIds = listMemberTable.getValuesInColumn("Id")
+ .stream().filter(x -> !x.contains("Coordinator"))
+ .collect(Collectors.toList());
TabularResultModel listClientsTable = gfsh.executeAndAssertThat("list
clients")
.statusIsSuccess()
@@ -149,7 +155,7 @@ public class DescribeClientCommandDUnitTest {
assertThat(Integer.parseInt(dataResult.get(CliStrings.DESCRIBE_CLIENT_COLUMN_QUEUE_SIZE)))
.isGreaterThan(0);
assertThat(dataResult.get(CliStrings.DESCRIBE_CLIENT_COLUMN_PRIMARY_SERVERS))
- .isEqualTo(server1Id);
+ .isIn(serverIds.toArray());
} else {
assertThat(describeClientTable.getValue(CliStrings.DESCRIBE_CLIENT_CQs,
0)).isEqualTo("1");
assertThat(dataResult.get(CliStrings.DESCRIBE_CLIENT_COLUMN_QUEUE_SIZE)).isEqualTo("0");