Skip to content

Commit

Permalink
Re-enable threadpool blocking in Kibana system index test (elastic#11…
Browse files Browse the repository at this point in the history
…2569)

KibanaThreadPoolIT checks the Kibana system user can write (using the
system read/write threadpools) even when the normal read/write
threadpools are blocked. This commit re-enables a key part of the test
which was disabled.

closes elastic#107625
  • Loading branch information
rjernst authored Oct 24, 2024
1 parent ebec1a2 commit 160faa2
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.search.SearchPhaseExecutionException;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.support.WriteRequest;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.common.settings.Settings;
Expand All @@ -37,6 +39,7 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.startsWith;

/**
Expand Down Expand Up @@ -150,15 +153,15 @@ private void assertThreadPoolsBlocked() {
new Thread(() -> expectThrows(EsRejectedExecutionException.class, () -> getFuture.actionGet(SAFE_AWAIT_TIMEOUT))).start();

// intentionally commented out this test until https://github.com/elastic/elasticsearch/issues/97916 is fixed
// var e3 = expectThrows(
// SearchPhaseExecutionException.class,
// () -> client().prepareSearch(USER_INDEX)
// .setQuery(QueryBuilders.matchAllQuery())
// // Request times out if max concurrent shard requests is set to 1
// .setMaxConcurrentShardRequests(usually() ? SearchRequest.DEFAULT_MAX_CONCURRENT_SHARD_REQUESTS : randomIntBetween(2, 10))
// .get()
// );
// assertThat(e3.getMessage(), containsString("all shards failed"));
var e3 = expectThrows(
SearchPhaseExecutionException.class,
() -> client().prepareSearch(USER_INDEX)
.setQuery(QueryBuilders.matchAllQuery())
// Request times out if max concurrent shard requests is set to 1
.setMaxConcurrentShardRequests(usually() ? SearchRequest.DEFAULT_MAX_CONCURRENT_SHARD_REQUESTS : randomIntBetween(2, 10))
.get()
);
assertThat(e3.getMessage(), containsString("all shards failed"));
}

protected void runWithBlockedThreadPools(Runnable runnable) throws Exception {
Expand Down

0 comments on commit 160faa2

Please sign in to comment.