Skip to content

Commit 588cf2c

Browse files
Feature reset integration test should tolerate failed resets (elastic#72326)
* Remove redundant section of test * Mention in javadoc that we check task index specifically
1 parent 0c94bc8 commit 588cf2c

File tree

1 file changed

+6
-9
lines changed
  • client/rest-high-level/src/test/java/org/elasticsearch/client

1 file changed

+6
-9
lines changed

client/rest-high-level/src/test/java/org/elasticsearch/client/FeaturesIT.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717

1818
import java.io.IOException;
1919
import java.util.Collections;
20-
import java.util.Set;
21-
import java.util.stream.Collectors;
2220

23-
import static org.hamcrest.Matchers.contains;
2421
import static org.hamcrest.Matchers.greaterThan;
2522
import static org.hamcrest.Matchers.notNullValue;
2623

@@ -37,6 +34,12 @@ public void testGetFeatures() throws IOException {
3734
assertTrue(response.getFeatures().stream().anyMatch(feature -> "tasks".equals(feature.getFeatureName())));
3835
}
3936

37+
/**
38+
* This test assumes that at least one of our defined features should reset successfully.
39+
* Since plugins should be testing their own reset operations if they use something
40+
* other than the default, this test tolerates failures in the response from the
41+
* feature reset API. We just need to check that we can reset the "tasks" system index.
42+
*/
4043
public void testResetFeatures() throws IOException {
4144
ResetFeaturesRequest request = new ResetFeaturesRequest();
4245

@@ -54,11 +57,5 @@ public void testResetFeatures() throws IOException {
5457
assertThat(response.getFeatureResetStatuses().size(), greaterThan(1));
5558
assertTrue(response.getFeatureResetStatuses().stream().anyMatch(
5659
feature -> "tasks".equals(feature.getFeatureName()) && "SUCCESS".equals(feature.getStatus())));
57-
58-
Set<String> statuses = response.getFeatureResetStatuses().stream()
59-
.map(ResetFeaturesResponse.ResetFeatureStateStatus::getStatus)
60-
.collect(Collectors.toSet());
61-
62-
assertThat(statuses, contains("SUCCESS"));
6360
}
6461
}

0 commit comments

Comments
 (0)