From 32bc0cd5d57894860fbff5bb8ac67179891e0201 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Thu, 13 Jul 2017 11:01:09 +0200 Subject: [PATCH] Tests: Add logging and error tracing to watcher bwc tests Original commit: elastic/x-pack-elasticsearch@4a4b65bcb7ac876a0e50711c8755951854371d51 --- .../upgrades/WatchBackwardsCompatibilityIT.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/WatchBackwardsCompatibilityIT.java b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/WatchBackwardsCompatibilityIT.java index c50cb014cea..e747fcf0d6a 100644 --- a/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/WatchBackwardsCompatibilityIT.java +++ b/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/WatchBackwardsCompatibilityIT.java @@ -100,6 +100,8 @@ public class WatchBackwardsCompatibilityIT extends ESRestTestCase { }); nodes = buildNodeAndVersions(); + logger.info("Nodes in cluster before test: bwc [{}], new [{}], master [{}]", nodes.getBWCNodes(), nodes.getNewNodes(), + nodes.getMaster()); } @Override @@ -159,11 +161,13 @@ public class WatchBackwardsCompatibilityIT extends ESRestTestCase { HttpHost[] newHosts = nodes.getNewNodes().stream().map(Node::getPublishAddress).toArray(HttpHost[]::new); if (newHosts.length > 0) { try (RestClient client = buildClient(restClientSettings(), newHosts)) { - logger.info("checking that upgrade procedure on the new cluster is required"); - Map response = toMap(client().performRequest("GET", "/_xpack/migration/assistance")); + logger.info("checking that upgrade procedure on the new cluster is required, hosts [{}]", Arrays.asList(newHosts)); + Map params = Collections.singletonMap("error_trace", "true"); + Map response = toMap(client().performRequest("GET", "_xpack/migration/assistance", params)); String action = ObjectPath.evaluate(response, "indices.\\.watches.action_required"); + logger.info("migration assistance response [{}]", action); if ("upgrade".equals(action)) { - client.performRequest("POST", "_xpack/migration/upgrade/.watches"); + client.performRequest("POST", "_xpack/migration/upgrade/.watches", params); } } } @@ -173,9 +177,6 @@ public class WatchBackwardsCompatibilityIT extends ESRestTestCase { throws IOException { HttpHost[] newHosts = nodes.getNewNodes().stream().map(Node::getPublishAddress).toArray(HttpHost[]::new); HttpHost[] bwcHosts = nodes.getBWCNodes().stream().map(Node::getPublishAddress).toArray(HttpHost[]::new); - - logger.info("# of bwc nodes [{}], number of new nodes [{}], master node [{}]", Arrays.asList(bwcHosts), Arrays.asList(newHosts), - nodes.getMaster().getPublishAddress()); assertTrue("No nodes in cluster, cannot run any tests", newHosts.length > 0 || bwcHosts.length > 0); if (newHosts.length > 0) {