From bf44b3387f9065689d2fef2294e8692289dd1c6b Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Tue, 8 Apr 2025 12:12:29 +1000 Subject: [PATCH 1/3] [Test] More reliable wait for index to appear Relates: #125652 Resolves: #126204 --- muted-tests.yml | 3 --- .../snapshots/SharedClusterSnapshotRestoreIT.java | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index f9f21223df5ed..f467b102b37e6 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -360,9 +360,6 @@ tests: - class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT method: test issue: https://github.com/elastic/elasticsearch/issues/126139 -- 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 diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java index 4dd63915467c3..61889486611b8 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java @@ -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)); + safeGet(clusterAdmin().prepareHealth(TEST_REQUEST_TIMEOUT, "test-idx").execute()); logger.info("--> delete index"); cluster().wipeIndices("test-idx"); From 119896b3d4b78f2cb30e13a58e38506fb9ef4e19 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Wed, 9 Apr 2025 13:20:56 +1000 Subject: [PATCH 2/3] review comments --- .../snapshots/SharedClusterSnapshotRestoreIT.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java index 61889486611b8..10e0d997bf272 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreIT.java @@ -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 - safeGet(clusterAdmin().prepareHealth(TEST_REQUEST_TIMEOUT, "test-idx").execute()); + safeGet(clusterAdmin().prepareHealth(SAFE_AWAIT_TIMEOUT, "test-idx").execute()); logger.info("--> delete index"); cluster().wipeIndices("test-idx"); @@ -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"); From 39d2270fc39d548246af5ff73ddb2acd10e3ca34 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Wed, 9 Apr 2025 13:23:54 +1000 Subject: [PATCH 3/3] fix merge --- muted-tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index 0b88f42cafdbb..58f39102eee1d 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -357,9 +357,6 @@ tests: - class: org.elasticsearch.search.basic.SearchWithRandomDisconnectsIT method: testSearchWithRandomDisconnects issue: https://github.com/elastic/elasticsearch/issues/122707 -- class: org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT - method: test - issue: https://github.com/elastic/elasticsearch/issues/126139 - class: org.elasticsearch.xpack.esql.inference.RerankOperatorTests method: testSimpleCircuitBreaking issue: https://github.com/elastic/elasticsearch/issues/124337