Skip to content

Commit 7ddcfeb

Browse files
authored
Fix KibanaThreadPoolIT (elastic#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 elastic#113939
1 parent 8114f85 commit 7ddcfeb

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

+10-6
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
import org.elasticsearch.action.search.SearchRequest;
1717
import org.elasticsearch.action.support.WriteRequest;
1818
import org.elasticsearch.client.internal.Client;
19+
import org.elasticsearch.cluster.metadata.IndexMetadata;
20+
import org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider;
1921
import org.elasticsearch.common.settings.Settings;
2022
import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException;
2123
import org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor;
2224
import org.elasticsearch.index.IndexingPressure;
2325
import org.elasticsearch.index.query.QueryBuilders;
2426
import org.elasticsearch.plugins.Plugin;
2527
import org.elasticsearch.test.ESIntegTestCase;
26-
import org.elasticsearch.test.junit.annotations.TestLogging;
2728
import org.elasticsearch.threadpool.ThreadPool;
2829
import org.elasticsearch.threadpool.ThreadPoolStats;
2930

@@ -49,10 +50,6 @@
4950
* threads that wait on a phaser. This lets us verify that operations on system indices
5051
* are being directed to other thread pools.</p>
5152
*/
52-
@TestLogging(
53-
reason = "investigate",
54-
value = "org.elasticsearch.kibana.KibanaThreadPoolIT:DEBUG,org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor:TRACE"
55-
)
5653
public class KibanaThreadPoolIT extends ESIntegTestCase {
5754
private static final Logger logger = LogManager.getLogger(KibanaThreadPoolIT.class);
5855

@@ -68,6 +65,8 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
6865
.put("thread_pool.write.queue_size", 1)
6966
.put("thread_pool.get.size", 1)
7067
.put("thread_pool.get.queue_size", 1)
68+
// a rejected GET may retry on an INITIALIZING shard (the target of a relocation) and unexpectedly succeed, so block rebalancing
69+
.put(EnableAllocationDecider.CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING.getKey(), EnableAllocationDecider.Rebalance.NONE)
7170
.build();
7271
}
7372

@@ -112,7 +111,12 @@ public void testKibanaThreadPoolByPassesBlockedThreadPools() throws Exception {
112111
}
113112

114113
public void testBlockedThreadPoolsRejectUserRequests() throws Exception {
115-
assertAcked(client().admin().indices().prepareCreate(USER_INDEX));
114+
assertAcked(
115+
client().admin()
116+
.indices()
117+
.prepareCreate(USER_INDEX)
118+
.setSettings(Settings.builder().put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0)) // avoid retrying rejected actions
119+
);
116120

117121
runWithBlockedThreadPools(this::assertThreadPoolsBlocked);
118122

muted-tests.yml

-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ tests:
5252
- class: org.elasticsearch.xpack.transform.integration.TransformIT
5353
method: testStopWaitForCheckpoint
5454
issue: https://github.com/elastic/elasticsearch/issues/106113
55-
- class: org.elasticsearch.kibana.KibanaThreadPoolIT
56-
method: testBlockedThreadPoolsRejectUserRequests
57-
issue: https://github.com/elastic/elasticsearch/issues/113939
5855
- class: org.elasticsearch.xpack.inference.TextEmbeddingCrudIT
5956
method: testPutE5Small_withPlatformAgnosticVariant
6057
issue: https://github.com/elastic/elasticsearch/issues/113983

0 commit comments

Comments
 (0)