23
23
import org .elasticsearch .indices .SystemIndexDescriptorUtils ;
24
24
import org .elasticsearch .plugins .Plugin ;
25
25
import org .elasticsearch .plugins .SystemIndexPlugin ;
26
+ import org .elasticsearch .synonyms .SynonymsAPI ;
26
27
import org .elasticsearch .test .ESIntegTestCase ;
27
28
28
29
import java .util .ArrayList ;
30
+ import java .util .Arrays ;
29
31
import java .util .Collection ;
30
32
import java .util .Collections ;
31
33
import java .util .List ;
@@ -48,7 +50,6 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {
48
50
}
49
51
50
52
/** Check that the reset method cleans up a feature */
51
- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/97780" )
52
53
public void testResetSystemIndices () throws Exception {
53
54
String systemIndex1 = ".test-system-idx-1" ;
54
55
String systemIndex2 = ".second-test-system-idx-1" ;
@@ -72,16 +73,18 @@ public void testResetSystemIndices() throws Exception {
72
73
73
74
// call the reset API
74
75
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 (
78
78
ResetFeatureStateResponse .ResetFeatureStateStatus .success ("SystemIndexTestPlugin" ),
79
79
ResetFeatureStateResponse .ResetFeatureStateStatus .success ("SecondSystemIndexTestPlugin" ),
80
80
ResetFeatureStateResponse .ResetFeatureStateStatus .success ("EvilSystemIndexTestPlugin" ),
81
- ResetFeatureStateResponse .ResetFeatureStateStatus .success ("tasks" ),
82
- ResetFeatureStateResponse .ResetFeatureStateStatus .success ("synonyms" )
81
+ ResetFeatureStateResponse .ResetFeatureStateStatus .success ("tasks" )
83
82
)
84
83
);
84
+ if (SynonymsAPI .isEnabled ()) {
85
+ successStatuses .add (ResetFeatureStateResponse .ResetFeatureStateStatus .success ("synonyms" ));
86
+ }
87
+ assertThat (apiResponse .getFeatureStateResetStatuses (), containsInAnyOrder (successStatuses .toArray ()));
85
88
86
89
// verify that both indices are gone
87
90
Exception e1 = expectThrows (IndexNotFoundException .class , () -> indicesAdmin ().prepareGetIndex ().addIndices (systemIndex1 ).get ());
0 commit comments