Skip to content

Commit 8bbd3e3

Browse files
authored
Address test failures for SmokeTestWatcherWithSecurityIT (#42092)
* Address test failures for SmokeTestWatcherWithSecurityIT There are likely multiple root causes to the seemingly random failures generated by SmokeTestWatcherWithSecurityIT. This commit un-mutes this this test, address one known cause and adds debug logging for this test. The known root cause for one failure is that we can have a Watch running that is reading data from an index. Before we stop Watcher we delete that index. If Watcher happens to execute after deletion of the index but before the stop of Watcher the test can fail. The fix here is to simply move the index deletion after the stop of Watcher. Related #35361 Related #30777 Related #33291 Related #29893
1 parent 5f3d0e4 commit 8bbd3e3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

x-pack/qa/smoke-test-watcher-with-security/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ integTestCluster {
2424
setting 'xpack.notification.email.account._email.smtp.user', '_user'
2525
keystoreSetting 'xpack.notification.email.account._email.smtp.secure_password', '_passwd'
2626
setting 'xpack.license.self_generated.type', 'trial'
27+
setting 'logger.org.elasticsearch.xpack.watcher', 'debug'
28+
setting 'logger.org.elasticsearch.xpack.core.watcher', 'debug'
2729
extraConfigFile 'roles.yml', 'roles.yml'
2830
setupCommand 'setupTestAdminUser',
2931
'bin/elasticsearch-users', 'useradd', 'test_admin', '-p', 'x-pack-test-password', '-r', 'superuser'

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package org.elasticsearch.smoketest;
77

88
import org.apache.http.util.EntityUtils;
9-
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
109
import org.elasticsearch.client.Request;
1110
import org.elasticsearch.client.Response;
1211
import org.elasticsearch.common.Strings;
@@ -32,7 +31,6 @@
3231
import static org.hamcrest.Matchers.hasEntry;
3332
import static org.hamcrest.Matchers.is;
3433

35-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/35361")
3634
public class SmokeTestWatcherWithSecurityIT extends ESRestTestCase {
3735

3836
private static final String TEST_ADMIN_USERNAME = "test_admin";
@@ -91,7 +89,6 @@ public void startWatcher() throws Exception {
9189

9290
@After
9391
public void stopWatcher() throws Exception {
94-
adminClient().performRequest(new Request("DELETE", "/my_test_index"));
9592

9693
assertBusy(() -> {
9794
try {
@@ -119,6 +116,8 @@ public void stopWatcher() throws Exception {
119116
throw new AssertionError(e);
120117
}
121118
});
119+
120+
adminClient().performRequest(new Request("DELETE", "/my_test_index"));
122121
}
123122

124123
@Override

0 commit comments

Comments
 (0)