Browse Source

Unmute test and capture watcher stats when failing.

Relates to #48381
Martijn van Groningen 5 years ago
parent
commit
9d7b80f05f

+ 12 - 5
x-pack/qa/full-cluster-restart/src/test/java/org/elasticsearch/xpack/restart/FullClusterRestartIT.java

@@ -120,17 +120,15 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
         assertRoleInfo(isRunningAgainstOldCluster());
     }
 
-    @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());
             Request createBwcWatch = new Request("PUT", "/_watcher/watch/bwc_watch");
-            Request createBwcThrottlePeriod = new Request("PUT", "/_watcher/watch/bwc_throttle_period");
-
             createBwcWatch.setJsonEntity(loadWatch("simple-watch.json"));
             client().performRequest(createBwcWatch);
 
             logger.info("Adding a watch with \"fun\" throttle periods on old cluster");
+            Request createBwcThrottlePeriod = new Request("PUT", "/_watcher/watch/bwc_throttle_period");
             createBwcThrottlePeriod.setJsonEntity(loadWatch("throttle-period-watch.json"));
             client().performRequest(createBwcThrottlePeriod);
 
@@ -143,8 +141,16 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
             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);
+                {
+                    String rsp = toStr(client().performRequest(new Request("GET", "/_cluster/state")));
+                    logger.info("cluster_state_response=\n{}", rsp);
+                }
+                {
+                    Request request = new Request("GET", "/_watcher/stats/_all");
+                    request.addParameter("emit_stacktraces", "true");
+                    String rsp = toStr(client().performRequest(request));
+                    logger.info("watcher_stats_response=\n{}", rsp);
+                }
                 throw e;
             }
             waitForHits("bwc_watch_index", 2);
@@ -425,6 +431,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
 
     private void waitForHits(String indexName, int expectedHits) throws Exception {
         Request request = new Request("GET", "/" + indexName + "/_search");
+        request.addParameter("ignore_unavailable", "true");
         request.addParameter("size", "0");
         assertBusy(() -> {
             try {