Skip to content

Commit

Permalink
Address test failures for SmokeTestWatcherWithSecurityIT (elastic#42092)
Browse files Browse the repository at this point in the history
* 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 elastic#35361
Related elastic#30777
Related elastic#33291
Related elastic#29893
  • Loading branch information
jakelandis authored and Gurkan Kaymak committed May 27, 2019
1 parent 3a3155b commit 48c7e33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions x-pack/qa/smoke-test-watcher-with-security/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ integTestCluster {
setting 'xpack.notification.email.account._email.smtp.user', '_user'
keystoreSetting 'xpack.notification.email.account._email.smtp.secure_password', '_passwd'
setting 'xpack.license.self_generated.type', 'trial'
setting 'logger.org.elasticsearch.xpack.watcher', 'debug'
setting 'logger.org.elasticsearch.xpack.core.watcher', 'debug'
extraConfigFile 'roles.yml', 'roles.yml'
setupCommand 'setupTestAdminUser',
'bin/elasticsearch-users', 'useradd', 'test_admin', '-p', 'x-pack-test-password', '-r', 'superuser'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package org.elasticsearch.smoketest;

import org.apache.http.util.EntityUtils;
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.common.Strings;
Expand All @@ -32,7 +31,6 @@
import static org.hamcrest.Matchers.hasEntry;
import static org.hamcrest.Matchers.is;

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

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

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

assertBusy(() -> {
try {
Expand Down Expand Up @@ -119,6 +116,8 @@ public void stopWatcher() throws Exception {
throw new AssertionError(e);
}
});

adminClient().performRequest(new Request("DELETE", "/my_test_index"));
}

@Override
Expand Down

0 comments on commit 48c7e33

Please sign in to comment.