Increase waiting time when check retention locks (#42994)

WriteActionsTests#testBulk and WriteActionsTests#testIndex sometimes
fail with a pending retention lock. We might leak retention locks when
switching to async recovery. However, it's more likely that ongoing
recoveries prevent the retention lock from releasing.

This change increases the waiting time when we check for no pending
retention lock and also ensures no ongoing recovery in
WriteActionsTests.

Closes #41054
This commit is contained in:
Nhat Nguyen 2019-06-10 12:31:02 -04:00
parent 4191df6e1d
commit f2e66e22eb
2 changed files with 5 additions and 1 deletions

View File

@ -1349,7 +1349,7 @@ public final class InternalTestCluster extends TestCluster {
}
}
}
});
}, 60, TimeUnit.SECONDS);
}
private void assertNoSnapshottedIndexCommit() throws Exception {

View File

@ -53,6 +53,7 @@ public class WriteActionsTests extends SecurityIntegTestCase {
//the missing index gets automatically created (user has permissions for that), but indexing fails due to missing authorization
assertThrowsAuthorizationExceptionDefaultUsers(client().prepareIndex("missing", "type", "id").setSource("field", "value")::get,
BulkAction.NAME + "[s]");
ensureGreen();
}
public void testDelete() {
@ -63,6 +64,7 @@ public class WriteActionsTests extends SecurityIntegTestCase {
assertThrowsAuthorizationExceptionDefaultUsers(client().prepareDelete("index1", "type", "id")::get, BulkAction.NAME + "[s]");
expectThrows(IndexNotFoundException.class, () -> client().prepareDelete("test4", "type", "id").get());
ensureGreen();
}
public void testUpdate() {
@ -79,6 +81,7 @@ public class WriteActionsTests extends SecurityIntegTestCase {
assertThrowsAuthorizationExceptionDefaultUsers(client().prepareUpdate("missing", "type", "id")
.setDoc(Requests.INDEX_CONTENT_TYPE, "field2", "value2")::get, UpdateAction.NAME);
ensureGreen();
}
public void testBulk() {
@ -160,5 +163,6 @@ public class WriteActionsTests extends SecurityIntegTestCase {
assertAuthorizationExceptionDefaultUsers(bulkResponse.getItems()[12].getFailure().getCause(), BulkAction.NAME + "[s]");
assertThat(bulkResponse.getItems()[12].getFailure().getCause().getMessage(),
containsString("[indices:data/write/bulk[s]] is unauthorized"));
ensureGreen();
}
}