diff --git a/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java b/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java index 66208479e065e..d0bdfe7eea09e 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java +++ b/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java @@ -1349,7 +1349,7 @@ private void assertOpenTranslogReferences() throws Exception { } } } - }); + }, 60, TimeUnit.SECONDS); } private void assertNoSnapshottedIndexCommit() throws Exception { diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java index 1f40f1c480f6b..12ae548119eec 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/WriteActionsTests.java @@ -53,6 +53,7 @@ public void testIndex() { //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 void testDelete() { 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 void testUpdate() { 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 void testBulk() { 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(); } }