Skip to content

Commit

Permalink
SmokeTestWatcherWithSecurityIT: Retry if failures searching .watcher-…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
jakelandis committed Jun 29, 2019
1 parent e6444d3 commit d57e1a2
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.apache.http.util.EntityUtils;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.SecureString;
import org.elasticsearch.common.settings.Settings;
Expand Down Expand Up @@ -330,6 +331,10 @@ private ObjectPath getWatchHistoryEntry(String watchId, String state) throws Exc
String watchid = objectPath.evaluate("hits.hits.0._source.watch_id");
assertThat(watchid, is(watchId));
objectPathReference.set(objectPath);
} catch (ResponseException e) {
final String err = "Failed to perform search of watcher history - " + e;
logger.info(err);
fail(err);
}
});
return objectPathReference.get();
Expand Down

0 comments on commit d57e1a2

Please sign in to comment.