|
12 | 12 | import org.apache.logging.log4j.LogManager;
|
13 | 13 | import org.apache.logging.log4j.Logger;
|
14 | 14 | import org.elasticsearch.action.bulk.BulkResponse;
|
| 15 | +import org.elasticsearch.action.search.SearchPhaseExecutionException; |
| 16 | +import org.elasticsearch.action.search.SearchRequest; |
15 | 17 | import org.elasticsearch.action.support.WriteRequest;
|
16 | 18 | import org.elasticsearch.client.internal.Client;
|
17 | 19 | import org.elasticsearch.common.settings.Settings;
|
|
37 | 39 | import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
38 | 40 | import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
|
39 | 41 | import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
|
| 42 | +import static org.hamcrest.Matchers.containsString; |
40 | 43 | import static org.hamcrest.Matchers.startsWith;
|
41 | 44 |
|
42 | 45 | /**
|
@@ -150,15 +153,15 @@ private void assertThreadPoolsBlocked() {
|
150 | 153 | new Thread(() -> expectThrows(EsRejectedExecutionException.class, () -> getFuture.actionGet(SAFE_AWAIT_TIMEOUT))).start();
|
151 | 154 |
|
152 | 155 | // intentionally commented out this test until https://github.com/elastic/elasticsearch/issues/97916 is fixed
|
153 |
| - // var e3 = expectThrows( |
154 |
| - // SearchPhaseExecutionException.class, |
155 |
| - // () -> client().prepareSearch(USER_INDEX) |
156 |
| - // .setQuery(QueryBuilders.matchAllQuery()) |
157 |
| - // // Request times out if max concurrent shard requests is set to 1 |
158 |
| - // .setMaxConcurrentShardRequests(usually() ? SearchRequest.DEFAULT_MAX_CONCURRENT_SHARD_REQUESTS : randomIntBetween(2, 10)) |
159 |
| - // .get() |
160 |
| - // ); |
161 |
| - // assertThat(e3.getMessage(), containsString("all shards failed")); |
| 156 | + var e3 = expectThrows( |
| 157 | + SearchPhaseExecutionException.class, |
| 158 | + () -> client().prepareSearch(USER_INDEX) |
| 159 | + .setQuery(QueryBuilders.matchAllQuery()) |
| 160 | + // Request times out if max concurrent shard requests is set to 1 |
| 161 | + .setMaxConcurrentShardRequests(usually() ? SearchRequest.DEFAULT_MAX_CONCURRENT_SHARD_REQUESTS : randomIntBetween(2, 10)) |
| 162 | + .get() |
| 163 | + ); |
| 164 | + assertThat(e3.getMessage(), containsString("all shards failed")); |
162 | 165 | }
|
163 | 166 |
|
164 | 167 | protected void runWithBlockedThreadPools(Runnable runnable) throws Exception {
|
|
0 commit comments