Skip to content

Commit a81c449

Browse files
authored
Fix timeout for awaiting index existence (#126773)
#126692 allowed consumers to specify a timeout to `awaitIndexExists`, but that timeout did not get propagated correctly to all the required places.
1 parent b6c9584 commit a81c449

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,8 +1748,12 @@ public static void awaitIndexExists(String index, Client client) {
17481748

17491749
public static void awaitIndexExists(String index, Client client, TimeValue timeout) {
17501750
assertThat("wildcards not supported", index, allOf(not(Metadata.ALL), not(containsString("*"))));
1751-
safeGet(
1752-
client.admin().cluster().prepareHealth(timeout, index).setIndicesOptions(IndicesOptions.LENIENT_EXPAND_OPEN_CLOSED).execute()
1751+
assertNoTimeout(
1752+
client.admin()
1753+
.cluster()
1754+
.prepareHealth(timeout, index)
1755+
.setTimeout(timeout)
1756+
.setIndicesOptions(IndicesOptions.LENIENT_EXPAND_OPEN_CLOSED)
17531757
);
17541758
}
17551759

0 commit comments

Comments
 (0)