From d3078c5b404ab00b34e2fbc5d6162f6358780370 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Mon, 6 Jan 2020 10:47:52 +0100 Subject: [PATCH] Re-enable FullClusterRestartIT#testWatcher test (#50463) Previously this test failed waiting for yellow: https://gradle-enterprise.elastic.co/s/fv55holsa36tg/console-log#L2676 Oddly cluster health returned red status, but there were no unassigned, relocating or initializing shards. Placed the waiting for green in a try-catch block, so that when this fails again then cluster state gets printed. Relates to #48381 --- .../xpack/restart/FullClusterRestartIT.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java b/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java index 27b717323fe25..28e3340ee7bc9 100644 --- a/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java +++ b/x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java @@ -146,7 +146,6 @@ public void testSecurityNativeRealm() throws Exception { } @SuppressWarnings("unchecked") - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/48381") public void testWatcher() throws Exception { if (isRunningAgainstOldCluster()) { logger.info("Adding a watch on old cluster {}", getOldClusterVersion()); @@ -169,13 +168,25 @@ public void testWatcher() throws Exception { client().performRequest(createFunnyTimeout); logger.info("Waiting for watch results index to fill up..."); - waitForYellow(".watches,bwc_watch_index,.watcher-history*"); + try { + waitForYellow(".watches,bwc_watch_index,.watcher-history*"); + } catch (ResponseException e) { + String rsp = toStr(client().performRequest(new Request("GET", "/_cluster/state"))); + logger.info("cluster_state_response=\n{}", rsp); + throw e; + } waitForHits("bwc_watch_index", 2); waitForHits(".watcher-history*", 2); logger.info("Done creating watcher-related indices"); } else { logger.info("testing against {}", getOldClusterVersion()); - waitForYellow(".watches,bwc_watch_index,.watcher-history*"); + try { + waitForYellow(".watches,bwc_watch_index,.watcher-history*"); + } catch (ResponseException e) { + String rsp = toStr(client().performRequest(new Request("GET", "/_cluster/state"))); + logger.info("cluster_state_response=\n{}", rsp); + throw e; + } logger.info("checking that the Watches index is the correct version");