Skip to content

Commit d57e1a2

Browse files
committed
SmokeTestWatcherWithSecurityIT: Retry if failures searching .watcher-history
Catch exceptions and fail (which allows the assertBusy to retry) if an error happens from the search against .watcher-history. Related: elastic#42409 Related: elastic#39169
1 parent e6444d3 commit d57e1a2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

x-pack/qa/smoke-test-watcher-with-security/src/test/java/org/elasticsearch/smoketest/SmokeTestWatcherWithSecurityIT.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.apache.http.util.EntityUtils;
99
import org.elasticsearch.client.Request;
1010
import org.elasticsearch.client.Response;
11+
import org.elasticsearch.client.ResponseException;
1112
import org.elasticsearch.common.Strings;
1213
import org.elasticsearch.common.settings.SecureString;
1314
import org.elasticsearch.common.settings.Settings;
@@ -330,6 +331,10 @@ private ObjectPath getWatchHistoryEntry(String watchId, String state) throws Exc
330331
String watchid = objectPath.evaluate("hits.hits.0._source.watch_id");
331332
assertThat(watchid, is(watchId));
332333
objectPathReference.set(objectPath);
334+
} catch (ResponseException e) {
335+
final String err = "Failed to perform search of watcher history - " + e;
336+
logger.info(err);
337+
fail(err);
333338
}
334339
});
335340
return objectPathReference.get();

0 commit comments

Comments
 (0)