From b1c8685cb12959332f910e0c5dd5b13f508d5dfe Mon Sep 17 00:00:00 2001 From: David Kyle Date: Mon, 26 Oct 2020 14:19:12 +0000 Subject: [PATCH 1/2] Mute DeleteExpiredDataIT (#64166) For #62699 # Conflicts: # x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java --- .../ml/integration/DeleteExpiredDataIT.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java index ee895121e8383..ea18c10b76071 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java @@ -96,10 +96,50 @@ public void testDeleteExpiredData_GivenNothingToDelete() throws Exception { client().execute(DeleteExpiredDataAction.INSTANCE, new DeleteExpiredDataAction.Request()).get(); } + @AwaitsFix( bugUrl = "https://github.com/elastic/elasticsearch/issues/62699") public void testDeleteExpiredDataNoThrottle() throws Exception { testExpiredDeletion(null, 10010); } + /** + * Verifies empty state indices deletion. Here is the summary of indices used by the test: + * + * +------------------+--------+----------+-------------------------+ + * | index name | empty? | current? | expected to be removed? | + * +------------------+--------+----------+-------------------------+ + * | .ml-state | yes | no | yes | + * | .ml-state-000001 | no | no | no | + * | .ml-state-000003 | yes | no | yes | + * | .ml-state-000005 | no | no | no | + * | .ml-state-000007 | yes | yes | no | + * +------------------+--------+----------+-------------------------+ + */ + public void testDeleteExpiredDataActionDeletesEmptyStateIndices() throws Exception { + client().admin().indices().prepareCreate(".ml-state").get(); + client().admin().indices().prepareCreate(".ml-state-000001").get(); + client().prepareIndex(".ml-state-000001").setSource("field_1", "value_1").get(); + client().admin().indices().prepareCreate(".ml-state-000003").get(); + client().admin().indices().prepareCreate(".ml-state-000005").get(); + client().prepareIndex(".ml-state-000005").setSource("field_5", "value_5").get(); + client().admin().indices().prepareCreate(".ml-state-000007").addAlias(new Alias(".ml-state-write").isHidden(true)).get(); + refresh(); + + GetIndexResponse getIndexResponse = client().admin().indices().prepareGetIndex().setIndices(".ml-state*").get(); + assertThat(Strings.toString(getIndexResponse), + getIndexResponse.getIndices(), + is(arrayContaining(".ml-state", ".ml-state-000001", ".ml-state-000003", ".ml-state-000005", ".ml-state-000007"))); + + client().execute(DeleteExpiredDataAction.INSTANCE, new DeleteExpiredDataAction.Request()).get(); + refresh(); + + getIndexResponse = client().admin().indices().prepareGetIndex().setIndices(".ml-state*").get(); + assertThat(Strings.toString(getIndexResponse), + getIndexResponse.getIndices(), + // Only non-empty or current indices should survive deletion process + is(arrayContaining(".ml-state-000001", ".ml-state-000005", ".ml-state-000007"))); + } + + @AwaitsFix( bugUrl = "https://github.com/elastic/elasticsearch/issues/62699") public void testDeleteExpiredDataWithStandardThrottle() throws Exception { testExpiredDeletion(-1.0f, 100); } From af409f76b23044f87f49beecb7fcabbbae33a2e7 Mon Sep 17 00:00:00 2001 From: David Kyle Date: Mon, 26 Oct 2020 14:43:12 +0000 Subject: [PATCH 2/2] fix merge --- .../ml/integration/DeleteExpiredDataIT.java | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java index ea18c10b76071..4f4d0937b803b 100644 --- a/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java +++ b/x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java @@ -101,44 +101,6 @@ public void testDeleteExpiredDataNoThrottle() throws Exception { testExpiredDeletion(null, 10010); } - /** - * Verifies empty state indices deletion. Here is the summary of indices used by the test: - * - * +------------------+--------+----------+-------------------------+ - * | index name | empty? | current? | expected to be removed? | - * +------------------+--------+----------+-------------------------+ - * | .ml-state | yes | no | yes | - * | .ml-state-000001 | no | no | no | - * | .ml-state-000003 | yes | no | yes | - * | .ml-state-000005 | no | no | no | - * | .ml-state-000007 | yes | yes | no | - * +------------------+--------+----------+-------------------------+ - */ - public void testDeleteExpiredDataActionDeletesEmptyStateIndices() throws Exception { - client().admin().indices().prepareCreate(".ml-state").get(); - client().admin().indices().prepareCreate(".ml-state-000001").get(); - client().prepareIndex(".ml-state-000001").setSource("field_1", "value_1").get(); - client().admin().indices().prepareCreate(".ml-state-000003").get(); - client().admin().indices().prepareCreate(".ml-state-000005").get(); - client().prepareIndex(".ml-state-000005").setSource("field_5", "value_5").get(); - client().admin().indices().prepareCreate(".ml-state-000007").addAlias(new Alias(".ml-state-write").isHidden(true)).get(); - refresh(); - - GetIndexResponse getIndexResponse = client().admin().indices().prepareGetIndex().setIndices(".ml-state*").get(); - assertThat(Strings.toString(getIndexResponse), - getIndexResponse.getIndices(), - is(arrayContaining(".ml-state", ".ml-state-000001", ".ml-state-000003", ".ml-state-000005", ".ml-state-000007"))); - - client().execute(DeleteExpiredDataAction.INSTANCE, new DeleteExpiredDataAction.Request()).get(); - refresh(); - - getIndexResponse = client().admin().indices().prepareGetIndex().setIndices(".ml-state*").get(); - assertThat(Strings.toString(getIndexResponse), - getIndexResponse.getIndices(), - // Only non-empty or current indices should survive deletion process - is(arrayContaining(".ml-state-000001", ".ml-state-000005", ".ml-state-000007"))); - } - @AwaitsFix( bugUrl = "https://github.com/elastic/elasticsearch/issues/62699") public void testDeleteExpiredDataWithStandardThrottle() throws Exception { testExpiredDeletion(-1.0f, 100);