From 606bc8037f05ae482679c7a7e609ec6e3acca601 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Tue, 18 Feb 2020 13:28:15 +0100 Subject: [PATCH] Adjusted assertion for watcher rolling upgrade test. (#52463) Relates to #33185 --- .../upgrades/UpgradeClusterClientYamlTestSuiteIT.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/UpgradeClusterClientYamlTestSuiteIT.java b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/UpgradeClusterClientYamlTestSuiteIT.java index bfeea6b3f39..1ca8aebbddb 100644 --- a/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/UpgradeClusterClientYamlTestSuiteIT.java +++ b/x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/UpgradeClusterClientYamlTestSuiteIT.java @@ -23,9 +23,10 @@ import java.nio.charset.StandardCharsets; import java.util.Base64; import java.util.List; import java.util.Map; +import java.util.concurrent.TimeUnit; import static org.hamcrest.Matchers.equalTo; - +import static org.hamcrest.Matchers.greaterThanOrEqualTo; @TimeoutSuite(millis = 5 * TimeUnits.MINUTE) // to account for slow as hell VMs public class UpgradeClusterClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase { @@ -46,12 +47,12 @@ public class UpgradeClusterClientYamlTestSuiteIT extends ESClientYamlSuiteTestCa Response response = client().performRequest(new Request("GET", "_watcher/stats")); Map responseBody = entityAsMap(response); List stats = (List) responseBody.get("stats"); - assertThat(stats.size(), equalTo(3)); + assertThat(stats.size(), greaterThanOrEqualTo(3)); for (Object stat : stats) { Map statAsMap = (Map) stat; assertThat(statAsMap.get("watcher_state"), equalTo("started")); } - }); + }, 1, TimeUnit.MINUTES); } @Override