Remove trappy timeouts from GetIndexRequest (#120037)

Relates #107984
This commit is contained in:
Niels Bauman 2025-01-16 16:05:36 +10:00 committed by GitHub
parent c0f54a94be
commit 9f597a4eb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
65 changed files with 240 additions and 143 deletions

View file

@ -242,7 +242,7 @@ public class DownsampleTransportFailureIT extends ESIntegTestCase {
private void assertIndexExists(final String nodeName, final String indexName) {
final GetIndexResponse getIndexResponse = client(nodeName).admin()
.indices()
.prepareGetIndex()
.prepareGetIndex(TEST_REQUEST_TIMEOUT)
.addIndices(indexName)
.addFeatures(GetIndexRequest.Feature.values())
.get();
@ -255,7 +255,7 @@ public class DownsampleTransportFailureIT extends ESIntegTestCase {
"Index [" + indexName + "] was not deleted",
() -> client(nodeName).admin()
.indices()
.prepareGetIndex()
.prepareGetIndex(TEST_REQUEST_TIMEOUT)
.addIndices(indexName)
.addFeatures(GetIndexRequest.Feature.values())
.get()

View file

@ -203,7 +203,7 @@ public class ILMDownsampleDisruptionIT extends ESIntegTestCase {
final GetIndexResponse getIndexResponse = cluster.client()
.admin()
.indices()
.getIndex(new GetIndexRequest().indices(targetIndex))
.getIndex(new GetIndexRequest(TEST_REQUEST_TIMEOUT).indices(targetIndex))
.actionGet();
assertEquals(1, getIndexResponse.indices().length);
assertResponse(

View file

@ -449,7 +449,9 @@ public class DownsampleActionSingleNodeTests extends ESSingleNodeTestCase {
prepareSourceIndex(sourceIndex, true);
downsample(sourceIndex, downsampleIndex, config);
GetIndexResponse indexSettingsResp = indicesAdmin().prepareGetIndex().addIndices(sourceIndex, downsampleIndex).get();
GetIndexResponse indexSettingsResp = indicesAdmin().prepareGetIndex(TEST_REQUEST_TIMEOUT)
.addIndices(sourceIndex, downsampleIndex)
.get();
assertDownsampleIndexSettings(sourceIndex, downsampleIndex, indexSettingsResp);
for (String key : settings.keySet()) {
if (LifecycleSettings.LIFECYCLE_NAME_SETTING.getKey().equals(key)) {
@ -605,7 +607,7 @@ public class DownsampleActionSingleNodeTests extends ESSingleNodeTestCase {
);
assertBusy(() -> {
try {
assertEquals(indicesAdmin().prepareGetIndex().addIndices(downsampleIndex).get().getIndices().length, 1);
assertEquals(indicesAdmin().prepareGetIndex(TEST_REQUEST_TIMEOUT).addIndices(downsampleIndex).get().getIndices().length, 1);
} catch (IndexNotFoundException e) {
fail("downsample index has not been created");
}
@ -1211,7 +1213,9 @@ public class DownsampleActionSingleNodeTests extends ESSingleNodeTestCase {
assertDownsampleIndexAggregations(sourceIndex, downsampleIndex, config, metricFields, labelFields);
GetIndexResponse indexSettingsResp = indicesAdmin().prepareGetIndex().addIndices(sourceIndex, downsampleIndex).get();
GetIndexResponse indexSettingsResp = indicesAdmin().prepareGetIndex(TEST_REQUEST_TIMEOUT)
.addIndices(sourceIndex, downsampleIndex)
.get();
assertDownsampleIndexSettings(sourceIndex, downsampleIndex, indexSettingsResp);
Map<String, Map<String, Object>> mappings = (Map<String, Map<String, Object>>) indexSettingsResp.getMappings()