99
1010package org .elasticsearch .lucene ;
1111
12- import org .apache .http .util .EntityUtils ;
1312import org .elasticsearch .client .Request ;
1413import org .elasticsearch .client .RequestOptions ;
1514import org .elasticsearch .client .Response ;
1817import org .elasticsearch .cluster .metadata .IndexMetadata ;
1918import org .elasticsearch .common .settings .Settings ;
2019import org .elasticsearch .test .cluster .util .Version ;
21- import org .elasticsearch .test .junit .annotations .TestIssueLogging ;
2220import org .elasticsearch .test .rest .ObjectPath ;
2321
2422import java .io .IOException ;
2523import java .util .HashMap ;
2624import java .util .Map ;
25+ import java .util .concurrent .TimeUnit ;
2726
2827import static org .hamcrest .Matchers .equalTo ;
2928
@@ -45,10 +44,6 @@ public FullClusterRestartSystemIndexCompatibilityIT(Version version) {
4544 * 2. After update to N-1 (latest) perform a system index migration step, also write block the index
4645 * 3. on N, check that async search results are still retrievable and we can write to the system index
4746 */
48- @ TestIssueLogging (
49- value = "org.elasticsearch.lucene.FullClusterRestartSystemIndexCompatibilityIT:DEBUG" ,
50- issueUrl = "https://github.com/elastic/elasticsearch/issues/127245"
51- )
5247 public void testAsyncSearchIndexMigration () throws Exception {
5348 final String index = suffix ("index" );
5449 final String asyncSearchIndex = ".async-search" ;
@@ -89,29 +84,19 @@ public void testAsyncSearchIndexMigration() throws Exception {
8984 ObjectPath .createFromResponse (client ().performRequest (migrateRequest )).evaluate ("features.0.feature_name" ),
9085 equalTo ("async_search" )
9186 );
92-
93- logger .debug ("--> starting system index migration" );
94- Request checkMigrateProgress = new Request ("GET" , "/_migration/system_features" );
95- try {
96- assertBusy (() -> {
97- Response resp = null ;
98- try {
99- assertFalse (
100- ObjectPath .createFromResponse (client ().performRequest (checkMigrateProgress ))
101- .evaluate ("migration_status" )
102- .equals ("IN_PROGRESS" )
103- );
104- } catch (IOException e ) {
105- throw new AssertionError ("System feature migration failed" , e );
106- }
107- });
108- } catch (AssertionError e ) {
109- logger .debug (
110- "--> system index migration not finished yet, response: {}" ,
111- EntityUtils .toString (client ().performRequest (checkMigrateProgress ).getEntity ())
112- );
113- throw e ;
114- }
87+ assertBusy (() -> {
88+ Request checkMigrateProgress = new Request ("GET" , "/_migration/system_features" );
89+ Response resp = null ;
90+ try {
91+ assertFalse (
92+ ObjectPath .createFromResponse (client ().performRequest (checkMigrateProgress ))
93+ .evaluate ("migration_status" )
94+ .equals ("IN_PROGRESS" )
95+ );
96+ } catch (IOException e ) {
97+ throw new AssertionError ("System feature migration failed" , e );
98+ }
99+ }, 30 , TimeUnit .SECONDS );
115100
116101 // check search results from n-2 search are still readable
117102 assertAsyncSearchHitCount (async_search_ids .get ("n-2_id" ), numDocs );
0 commit comments