Skip to content

Commit d3078c5

Browse files
committed
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
1 parent 53ac28e commit d3078c5

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ public void testSecurityNativeRealm() throws Exception {
146146
}
147147

148148
@SuppressWarnings("unchecked")
149-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/48381")
150149
public void testWatcher() throws Exception {
151150
if (isRunningAgainstOldCluster()) {
152151
logger.info("Adding a watch on old cluster {}", getOldClusterVersion());
@@ -169,13 +168,25 @@ public void testWatcher() throws Exception {
169168
client().performRequest(createFunnyTimeout);
170169

171170
logger.info("Waiting for watch results index to fill up...");
172-
waitForYellow(".watches,bwc_watch_index,.watcher-history*");
171+
try {
172+
waitForYellow(".watches,bwc_watch_index,.watcher-history*");
173+
} catch (ResponseException e) {
174+
String rsp = toStr(client().performRequest(new Request("GET", "/_cluster/state")));
175+
logger.info("cluster_state_response=\n{}", rsp);
176+
throw e;
177+
}
173178
waitForHits("bwc_watch_index", 2);
174179
waitForHits(".watcher-history*", 2);
175180
logger.info("Done creating watcher-related indices");
176181
} else {
177182
logger.info("testing against {}", getOldClusterVersion());
178-
waitForYellow(".watches,bwc_watch_index,.watcher-history*");
183+
try {
184+
waitForYellow(".watches,bwc_watch_index,.watcher-history*");
185+
} catch (ResponseException e) {
186+
String rsp = toStr(client().performRequest(new Request("GET", "/_cluster/state")));
187+
logger.info("cluster_state_response=\n{}", rsp);
188+
throw e;
189+
}
179190

180191
logger.info("checking that the Watches index is the correct version");
181192

0 commit comments

Comments
 (0)