Skip to content

Commit d64d3f7

Browse files
committed
Revert "Fix timeout in testDowngradeRemoteClusterToBasic (#52284)"
This reverts commit 1342f86.
1 parent 623990e commit d64d3f7

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -950,18 +950,14 @@ protected static void ensureHealth(Consumer<Request> requestConsumer) throws IOE
950950
}
951951

952952
protected static void ensureHealth(String index, Consumer<Request> requestConsumer) throws IOException {
953-
ensureHealth(client(), index, requestConsumer);
954-
}
955-
956-
protected static void ensureHealth(RestClient client, String index, Consumer<Request> requestConsumer) throws IOException {
957953
Request request = new Request("GET", "/_cluster/health" + (index.isBlank() ? "" : "/" + index));
958954
requestConsumer.accept(request);
959955
try {
960-
client.performRequest(request);
956+
client().performRequest(request);
961957
} catch (ResponseException e) {
962958
if (e.getResponse().getStatusLine().getStatusCode() == HttpStatus.SC_REQUEST_TIMEOUT) {
963959
try {
964-
final Response clusterStateResponse = client.performRequest(new Request("GET", "/_cluster/state?pretty"));
960+
final Response clusterStateResponse = client().performRequest(new Request("GET", "/_cluster/state?pretty"));
965961
fail("timed out waiting for green state for index [" + index + "] " +
966962
"cluster state [" + EntityUtils.toString(clusterStateResponse.getEntity()) + "]");
967963
} catch (Exception inner) {

x-pack/plugin/ccr/qa/downgrade-to-basic-license/src/test/java/org/elasticsearch/xpack/ccr/FollowIndexIT.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.io.IOException;
2020
import java.nio.file.Path;
2121
import java.util.Map;
22-
import java.util.concurrent.TimeUnit;
2322
import java.util.stream.Stream;
2423

2524
import static org.elasticsearch.common.xcontent.ObjectPath.eval;
@@ -49,7 +48,7 @@ public void testDowngradeRemoteClusterToBasic() throws Exception {
4948
assertBusy(() -> {
5049
ensureYellow(index1);
5150
verifyDocuments(index1, 5, "filtered_field:true");
52-
}, 60, TimeUnit.SECONDS);
51+
});
5352

5453
String index2 = "logs-20190102";
5554
try (RestClient leaderClient = buildLeaderClient()) {
@@ -89,7 +88,7 @@ public void testDowngradeRemoteClusterToBasic() throws Exception {
8988
}
9089
});
9190
}
92-
}, 60, TimeUnit.SECONDS);
91+
});
9392

9493
// Manually following index2 also does not work after the downgrade:
9594
Exception e = expectThrows(ResponseException.class, () -> followIndex("leader_cluster", index2));

x-pack/plugin/ccr/qa/src/main/java/org/elasticsearch/xpack/ccr/ESCCRRestTestCase.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,14 @@ protected static void ensureYellow(final String index) throws IOException {
215215
}
216216

217217
protected static void ensureYellow(final String index, final RestClient client) throws IOException {
218-
ensureHealth(client, index, request -> {
219-
request.addParameter("wait_for_status", "yellow");
220-
request.addParameter("wait_for_no_relocating_shards", "true");
221-
request.addParameter("timeout", "5s");
222-
request.addParameter("level", "shards");
223-
});
218+
final Request request = new Request("GET", "/_cluster/health/" + index);
219+
request.addParameter("wait_for_status", "yellow");
220+
request.addParameter("wait_for_active_shards", "1");
221+
request.addParameter("wait_for_no_relocating_shards", "true");
222+
request.addParameter("wait_for_no_initializing_shards", "true");
223+
request.addParameter("timeout", "5s");
224+
request.addParameter("level", "shards");
225+
client.performRequest(request);
224226
}
225227

226228
protected int countCcrNodeTasks() throws IOException {

0 commit comments

Comments
 (0)