Skip to content

Commit 2c3bf44

Browse files
committed
Increase timeout, migration might be occasionally slow
1 parent f0dede0 commit 2c3bf44

File tree

1 file changed

+14
-29
lines changed

1 file changed

+14
-29
lines changed

qa/lucene-index-compatibility/src/javaRestTest/java/org/elasticsearch/lucene/FullClusterRestartSystemIndexCompatibilityIT.java

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
package org.elasticsearch.lucene;
1111

12-
import org.apache.http.util.EntityUtils;
1312
import org.elasticsearch.client.Request;
1413
import org.elasticsearch.client.RequestOptions;
1514
import org.elasticsearch.client.Response;
@@ -18,12 +17,12 @@
1817
import org.elasticsearch.cluster.metadata.IndexMetadata;
1918
import org.elasticsearch.common.settings.Settings;
2019
import org.elasticsearch.test.cluster.util.Version;
21-
import org.elasticsearch.test.junit.annotations.TestIssueLogging;
2220
import org.elasticsearch.test.rest.ObjectPath;
2321

2422
import java.io.IOException;
2523
import java.util.HashMap;
2624
import java.util.Map;
25+
import java.util.concurrent.TimeUnit;
2726

2827
import 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

Comments
 (0)