Skip to content

Commit ae1b132

Browse files
authored
Only check non-negative stats for active, current and queue (#117834)
In SimpleThreadPoolIT, stats are gathered for each threadpool being checked, then measurements are collected. Some stats may go up or down depending on other background tasks outside the test. This commit adjusts the check for those stats to only check collecting non-negative values. closes #108320
1 parent d3f0ae0 commit ae1b132

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ tests:
141141
- class: org.elasticsearch.xpack.shutdown.NodeShutdownIT
142142
method: testAllocationPreventedForRemoval
143143
issue: https://github.com/elastic/elasticsearch/issues/116363
144-
- class: org.elasticsearch.threadpool.SimpleThreadPoolIT
145-
method: testThreadPoolMetrics
146-
issue: https://github.com/elastic/elasticsearch/issues/108320
147144
- class: org.elasticsearch.xpack.downsample.ILMDownsampleDisruptionIT
148145
method: testILMDownsampleRollingRestart
149146
issue: https://github.com/elastic/elasticsearch/issues/114233

server/src/internalClusterTest/java/org/elasticsearch/threadpool/SimpleThreadPoolIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ public void testThreadPoolMetrics() throws Exception {
167167
tps[0].forEach(stats -> {
168168
Map<String, Long> threadPoolStats = List.of(
169169
Map.entry(ThreadPool.THREAD_POOL_METRIC_NAME_COMPLETED, stats.completed()),
170-
Map.entry(ThreadPool.THREAD_POOL_METRIC_NAME_ACTIVE, (long) stats.active()),
171-
Map.entry(ThreadPool.THREAD_POOL_METRIC_NAME_CURRENT, (long) stats.threads()),
170+
Map.entry(ThreadPool.THREAD_POOL_METRIC_NAME_ACTIVE, 0L),
171+
Map.entry(ThreadPool.THREAD_POOL_METRIC_NAME_CURRENT, 0L),
172172
Map.entry(ThreadPool.THREAD_POOL_METRIC_NAME_LARGEST, (long) stats.largest()),
173-
Map.entry(ThreadPool.THREAD_POOL_METRIC_NAME_QUEUE, (long) stats.queue())
173+
Map.entry(ThreadPool.THREAD_POOL_METRIC_NAME_QUEUE, 0L)
174174
).stream().collect(toUnmodifiableSortedMap(e -> stats.name() + e.getKey(), Entry::getValue));
175175

176176
Function<String, List<Long>> measurementExtractor = name -> {

0 commit comments

Comments
 (0)