Skip to content

Commit f3b328e

Browse files
committed
Fix KibanaThreadPoolIT (#120097)
This test will fail to see the rejection if the GET retries on a different shard copy, so with this commit we make sure there are no spare shard copies on which to retry. Closes #113939
1 parent 4b12b98 commit f3b328e

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

modules/kibana/src/internalClusterTest/java/org/elasticsearch/kibana/KibanaThreadPoolIT.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
import org.elasticsearch.action.bulk.BulkResponse;
1515
import org.elasticsearch.action.support.WriteRequest;
1616
import org.elasticsearch.client.internal.Client;
17+
import org.elasticsearch.cluster.metadata.IndexMetadata;
18+
import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider;
1719
import org.elasticsearch.common.settings.Settings;
1820
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
1921
import org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor;
2022
import org.elasticsearch.index.IndexingPressure;
2123
import org.elasticsearch.index.query.QueryBuilders;
2224
import org.elasticsearch.plugins.Plugin;
2325
import org.elasticsearch.test.ESIntegTestCase;
24-
import org.elasticsearch.test.junit.annotations.TestLogging;
2526
import org.elasticsearch.threadpool.ThreadPool;
2627
import org.elasticsearch.threadpool.ThreadPoolStats;
2728

@@ -46,10 +47,6 @@
4647
* threads that wait on a phaser. This lets us verify that operations on system indices
4748
* are being directed to other thread pools.</p>
4849
*/
49-
@TestLogging(
50-
reason = "investigate",
51-
value = "org.elasticsearch.kibana.KibanaThreadPoolIT:DEBUG,org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor:TRACE"
52-
)
5350
public class KibanaThreadPoolIT extends ESIntegTestCase {
5451
private static final Logger logger = LogManager.getLogger(KibanaThreadPoolIT.class);
5552

@@ -65,6 +62,8 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
6562
.put("thread_pool.write.queue_size", 1)
6663
.put("thread_pool.get.size", 1)
6764
.put("thread_pool.get.queue_size", 1)
65+
// a rejected GET may retry on an INITIALIZING shard (the target of a relocation) and unexpectedly succeed, so block rebalancing
66+
.put(EnableAllocationDecider.CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), EnableAllocationDecider.Rebalance.NONE)
6867
.build();
6968
}
7069

@@ -109,7 +108,12 @@ public void testKibanaThreadPoolByPassesBlockedThreadPools() throws Exception {
109108
}
110109

111110
public void testBlockedThreadPoolsRejectUserRequests() throws Exception {
112-
assertAcked(client().admin().indices().prepareCreate(USER_INDEX));
111+
assertAcked(
112+
client().admin()
113+
.indices()
114+
.prepareCreate(USER_INDEX)
115+
.setSettings(Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)) // avoid retrying rejected actions
116+
);
113117

114118
runWithBlockedThreadPools(this::assertThreadPoolsBlocked);
115119

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ tests:
199199
- class: org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT
200200
method: test {categorize.Categorize ASYNC}
201201
issue: https://github.com/elastic/elasticsearch/issues/116373
202-
- class: org.elasticsearch.kibana.KibanaThreadPoolIT
203-
method: testBlockedThreadPoolsRejectUserRequests
204-
issue: https://github.com/elastic/elasticsearch/issues/113939
205202
- class: org.elasticsearch.xpack.inference.TextEmbeddingCrudIT
206203
method: testPutE5WithTrainedModelAndInference
207204
issue: https://github.com/elastic/elasticsearch/issues/114023

0 commit comments

Comments
 (0)