Skip to content

[Test] More reliable wait for index to appear #126437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,6 @@ tests:
- class: org.elasticsearch.search.basic.SearchWithRandomDisconnectsIT
method: testSearchWithRandomDisconnects
issue: https://github.com/elastic/elasticsearch/issues/122707
- class: org.elasticsearch.snapshots.SharedClusterSnapshotRestoreIT
method: testDeletionOfFailingToRecoverIndexShouldStopRestore
issue: https://github.com/elastic/elasticsearch/issues/126204
- class: org.elasticsearch.xpack.esql.inference.RerankOperatorTests
method: testSimpleCircuitBreaking
issue: https://github.com/elastic/elasticsearch/issues/124337
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ public void testDeletionOfFailingToRecoverIndexShouldStopRestore() throws Except

logger.info("--> wait for the index to appear");
// that would mean that recovery process started and failing
waitForIndex("test-idx", TimeValue.timeValueSeconds(10));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only caller of waitForIndex so I suggest removing the method itself too.

safeGet(clusterAdmin().prepareHealth(SAFE_AWAIT_TIMEOUT, "test-idx").execute());

logger.info("--> delete index");
cluster().wipeIndices("test-idx");
Expand Down Expand Up @@ -1619,14 +1619,6 @@ public void testDeleteSnapshotWhileRestoringFails() throws Exception {
restoreFut.get();
}

private void waitForIndex(final String index, TimeValue timeout) throws Exception {
assertBusy(
() -> assertTrue("Expected index [" + index + "] to exist", indexExists(index)),
timeout.millis(),
TimeUnit.MILLISECONDS
);
}

public void testSnapshotName() throws Exception {
disableRepoConsistencyCheck("This test does not create any data in the repository");

Expand Down