Skip to content

Commit 8a4a26d

Browse files
authored
SmokeTestWatcherWithSecurityIT: Retry if failures searching (#43781)
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: #42409 Related: #39169
1 parent 21a368d commit 8a4a26d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
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";
336+
logger.info(err, e);
337+
fail(err);
333338
}
334339
});
335340
return objectPathReference.get();

x-pack/qa/smoke-test-watcher/src/test/java/org/elasticsearch/smoketest/SmokeTestWatcherTestSuiteIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ private ObjectPath getWatchHistoryEntry(String watchId) throws Exception {
216216
assertThat("watch_id for hit 0 in watcher history", foundWatchId, is(watchId));
217217
objectPathReference.set(objectPath);
218218
} catch (ResponseException e) {
219-
final String err = "Failed to perform search of watcher history - " + e;
220-
logger.info(err);
219+
final String err = "Failed to perform search of watcher history";
220+
logger.info(err, e);
221221
fail(err);
222222
}
223223
});

0 commit comments

Comments
 (0)