Skip to content

Commit af997d3

Browse files
authored
Fixed failing test that depends on synonyms feature (#98129)
1 parent 51ca633 commit af997d3

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

docs/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ testClusters.matching { it.name == "yamlRestTest"}.configureEach {
101101

102102
requiresFeature 'es.index_mode_feature_flag_registered', Version.fromString("8.0.0")
103103
requiresFeature 'es.dlm_feature_flag_enabled', Version.fromString("8.8.0")
104+
requiresFeature 'es.synonyms_api_feature_flag_enabled', Version.fromString("8.9.0")
104105

105106
// build the cluster with all plugins
106107
project.rootProject.subprojects.findAll { it.parent.path == ':plugins' }.each { subproj ->
@@ -124,6 +125,7 @@ tasks.named("yamlRestTest").configure {
124125
}
125126
if (BuildParams.isSnapshotBuild() == false) {
126127
systemProperty 'es.dlm_feature_flag_enabled', 'true'
128+
systemProperty 'es.synonyms_api_feature_flag_enabled', 'true'
127129
}
128130
}
129131

docs/reference/migration/apis/feature-migration.asciidoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ Example response:
142142
"migration_status" : "NO_MIGRATION_NEEDED"
143143
}
144144
--------------------------------------------------
145-
// TESTRESPONSE[skip:"AwaitsFix https://github.com/elastic/elasticsearch/issues/97780]
146145

147146
When you submit a POST request to the `_migration/system_features` endpoint to
148147
start the migration process, the response indicates what features will be

server/src/internalClusterTest/java/org/elasticsearch/snapshots/FeatureStateResetApiIT.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
import org.elasticsearch.indices.SystemIndexDescriptorUtils;
2424
import org.elasticsearch.plugins.Plugin;
2525
import org.elasticsearch.plugins.SystemIndexPlugin;
26+
import org.elasticsearch.synonyms.SynonymsAPI;
2627
import org.elasticsearch.test.ESIntegTestCase;
2728

2829
import java.util.ArrayList;
30+
import java.util.Arrays;
2931
import java.util.Collection;
3032
import java.util.Collections;
3133
import java.util.List;
@@ -48,7 +50,6 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
4850
}
4951

5052
/** Check that the reset method cleans up a feature */
51-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/97780")
5253
public void testResetSystemIndices() throws Exception {
5354
String systemIndex1 = ".test-system-idx-1";
5455
String systemIndex2 = ".second-test-system-idx-1";
@@ -72,16 +73,18 @@ public void testResetSystemIndices() throws Exception {
7273

7374
// call the reset API
7475
ResetFeatureStateResponse apiResponse = client().execute(ResetFeatureStateAction.INSTANCE, new ResetFeatureStateRequest()).get();
75-
assertThat(
76-
apiResponse.getFeatureStateResetStatuses(),
77-
containsInAnyOrder(
76+
Collection<ResetFeatureStateResponse.ResetFeatureStateStatus> successStatuses = new ArrayList<>(
77+
Arrays.asList(
7878
ResetFeatureStateResponse.ResetFeatureStateStatus.success("SystemIndexTestPlugin"),
7979
ResetFeatureStateResponse.ResetFeatureStateStatus.success("SecondSystemIndexTestPlugin"),
8080
ResetFeatureStateResponse.ResetFeatureStateStatus.success("EvilSystemIndexTestPlugin"),
81-
ResetFeatureStateResponse.ResetFeatureStateStatus.success("tasks"),
82-
ResetFeatureStateResponse.ResetFeatureStateStatus.success("synonyms")
81+
ResetFeatureStateResponse.ResetFeatureStateStatus.success("tasks")
8382
)
8483
);
84+
if (SynonymsAPI.isEnabled()) {
85+
successStatuses.add(ResetFeatureStateResponse.ResetFeatureStateStatus.success("synonyms"));
86+
}
87+
assertThat(apiResponse.getFeatureStateResetStatuses(), containsInAnyOrder(successStatuses.toArray()));
8588

8689
// verify that both indices are gone
8790
Exception e1 = expectThrows(IndexNotFoundException.class, () -> indicesAdmin().prepareGetIndex().addIndices(systemIndex1).get());

0 commit comments

Comments
 (0)