Skip to content

Commit b1c8685

Browse files
committed
Mute DeleteExpiredDataIT (elastic#64166)
For elastic#62699 # Conflicts: # x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java
1 parent d727c33 commit b1c8685

File tree

1 file changed

+40
-0
lines changed
  • x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration

1 file changed

+40
-0
lines changed

x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/DeleteExpiredDataIT.java

+40
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,50 @@ public void testDeleteExpiredData_GivenNothingToDelete() throws Exception {
9696
client().execute(DeleteExpiredDataAction.INSTANCE, new DeleteExpiredDataAction.Request()).get();
9797
}
9898

99+
@AwaitsFix( bugUrl = "https://github.com/elastic/elasticsearch/issues/62699")
99100
public void testDeleteExpiredDataNoThrottle() throws Exception {
100101
testExpiredDeletion(null, 10010);
101102
}
102103

104+
/**
105+
* Verifies empty state indices deletion. Here is the summary of indices used by the test:
106+
*
107+
* +------------------+--------+----------+-------------------------+
108+
* | index name | empty? | current? | expected to be removed? |
109+
* +------------------+--------+----------+-------------------------+
110+
* | .ml-state | yes | no | yes |
111+
* | .ml-state-000001 | no | no | no |
112+
* | .ml-state-000003 | yes | no | yes |
113+
* | .ml-state-000005 | no | no | no |
114+
* | .ml-state-000007 | yes | yes | no |
115+
* +------------------+--------+----------+-------------------------+
116+
*/
117+
public void testDeleteExpiredDataActionDeletesEmptyStateIndices() throws Exception {
118+
client().admin().indices().prepareCreate(".ml-state").get();
119+
client().admin().indices().prepareCreate(".ml-state-000001").get();
120+
client().prepareIndex(".ml-state-000001").setSource("field_1", "value_1").get();
121+
client().admin().indices().prepareCreate(".ml-state-000003").get();
122+
client().admin().indices().prepareCreate(".ml-state-000005").get();
123+
client().prepareIndex(".ml-state-000005").setSource("field_5", "value_5").get();
124+
client().admin().indices().prepareCreate(".ml-state-000007").addAlias(new Alias(".ml-state-write").isHidden(true)).get();
125+
refresh();
126+
127+
GetIndexResponse getIndexResponse = client().admin().indices().prepareGetIndex().setIndices(".ml-state*").get();
128+
assertThat(Strings.toString(getIndexResponse),
129+
getIndexResponse.getIndices(),
130+
is(arrayContaining(".ml-state", ".ml-state-000001", ".ml-state-000003", ".ml-state-000005", ".ml-state-000007")));
131+
132+
client().execute(DeleteExpiredDataAction.INSTANCE, new DeleteExpiredDataAction.Request()).get();
133+
refresh();
134+
135+
getIndexResponse = client().admin().indices().prepareGetIndex().setIndices(".ml-state*").get();
136+
assertThat(Strings.toString(getIndexResponse),
137+
getIndexResponse.getIndices(),
138+
// Only non-empty or current indices should survive deletion process
139+
is(arrayContaining(".ml-state-000001", ".ml-state-000005", ".ml-state-000007")));
140+
}
141+
142+
@AwaitsFix( bugUrl = "https://github.com/elastic/elasticsearch/issues/62699")
103143
public void testDeleteExpiredDataWithStandardThrottle() throws Exception {
104144
testExpiredDeletion(-1.0f, 100);
105145
}

0 commit comments

Comments
 (0)