Skip to content

Commit 4f9bfb0

Browse files
authored
[Test] More reliable wait for index to appear (#126437)
Relates: #125652 Resolves: #126204
1 parent d2be03c commit 4f9bfb0

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,6 @@ tests:
357357
- class: org.elasticsearch.search.basic.SearchWithRandomDisconnectsIT
358358
method: testSearchWithRandomDisconnects
359359
issue: https://github.com/elastic/elasticsearch/issues/122707
360-
- class: org.elasticsearch.snapshots.SharedClusterSnapshotRestoreIT
361-
method: testDeletionOfFailingToRecoverIndexShouldStopRestore
362-
issue: https://github.com/elastic/elasticsearch/issues/126204
363360
- class: org.elasticsearch.xpack.esql.inference.RerankOperatorTests
364361
method: testSimpleCircuitBreaking
365362
issue: https://github.com/elastic/elasticsearch/issues/124337

server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ public void testDeletionOfFailingToRecoverIndexShouldStopRestore() throws Except
748748

749749
logger.info("--> wait for the index to appear");
750750
// that would mean that recovery process started and failing
751-
waitForIndex("test-idx", TimeValue.timeValueSeconds(10));
751+
safeGet(clusterAdmin().prepareHealth(SAFE_AWAIT_TIMEOUT, "test-idx").execute());
752752

753753
logger.info("--> delete index");
754754
cluster().wipeIndices("test-idx");
@@ -1619,14 +1619,6 @@ public void testDeleteSnapshotWhileRestoringFails() throws Exception {
16191619
restoreFut.get();
16201620
}
16211621

1622-
private void waitForIndex(final String index, TimeValue timeout) throws Exception {
1623-
assertBusy(
1624-
() -> assertTrue("Expected index [" + index + "] to exist", indexExists(index)),
1625-
timeout.millis(),
1626-
TimeUnit.MILLISECONDS
1627-
);
1628-
}
1629-
16301622
public void testSnapshotName() throws Exception {
16311623
disableRepoConsistencyCheck("This test does not create any data in the repository");
16321624

0 commit comments

Comments
 (0)