Skip to content

Commit

Permalink
Re-enable FullClusterRestartIT#testWatcher test (#50463)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
martijnvg committed Jan 24, 2020
1 parent 53ac28e commit d3078c5
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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");

Expand Down

0 comments on commit d3078c5

Please sign in to comment.