Skip to content

Commit a79ea5d

Browse files
authored
Fix testDoesNotResolveClosedIndex (#133302)
As commented, the index must have all replica shards assigned before closing. Create index and prior indexing only guarantee primary shard is assigned.
1 parent 5ad6a0e commit a79ea5d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/plugin/IndexResolutionIT.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.elasticsearch.datastreams.DataStreamsPlugin;
2020
import org.elasticsearch.index.IndexNotFoundException;
2121
import org.elasticsearch.plugins.Plugin;
22-
import org.elasticsearch.test.junit.annotations.TestIssueLogging;
2322
import org.elasticsearch.xpack.esql.VerificationException;
2423
import org.elasticsearch.xpack.esql.action.AbstractEsqlIntegTestCase;
2524
import org.elasticsearch.xpack.esql.action.EsqlQueryResponse;
@@ -110,13 +109,12 @@ public void testDoesNotResolveEmptyPattern() {
110109
);
111110
}
112111

113-
@TestIssueLogging(
114-
value = "org.elasticsearch.cluster.metadata.MetadataIndexStateService:DEBUG",
115-
issueUrl = "https://github.com/elastic/elasticsearch/issues/133011"
116-
)
117112
public void testDoesNotResolveClosedIndex() {
118113
assertAcked(client().admin().indices().prepareCreate("index-1"));
119114
indexRandom(true, "index-1", 10);
115+
// Create index only waits for primary/indexing shard to be assigned.
116+
// This is enough to index and search documents, however all shards (including replicas) must be assigned before close.
117+
ensureGreen("index-1");
120118
assertAcked(client().admin().indices().prepareClose("index-1"));
121119
assertAcked(client().admin().indices().prepareCreate("index-2"));
122120
indexRandom(true, "index-2", 15);

0 commit comments

Comments
 (0)