Skip to content

Commit 198e676

Browse files
nicktindallKubik42
authored andcommitted
Fix ClusterInfoServiceIT#testMaxQueueLatenciesInClusterInfo (elastic#136461)
Closes: elastic#134500
1 parent 82a3777 commit 198e676

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,6 @@ tests:
441441
- class: org.elasticsearch.action.admin.cluster.state.TransportClusterStateActionTests
442442
method: testGetClusterStateWithDefaultProjectOnly
443443
issue: https://github.com/elastic/elasticsearch/issues/134450
444-
- class: org.elasticsearch.cluster.ClusterInfoServiceIT
445-
method: testMaxQueueLatenciesInClusterInfo
446-
issue: https://github.com/elastic/elasticsearch/issues/134500
447444
- class: org.elasticsearch.xpack.esql.expression.function.scalar.score.DecayTests
448445
method: "testEvaluateBlockWithNulls {TestCase=<date_nanos>, <date_nanos>, <time_duration>, <_source> #11}"
449446
issue: https://github.com/elastic/elasticsearch/issues/134509

server/src/internalClusterTest/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,12 @@ public void testMaxQueueLatenciesInClusterInfo() throws Exception {
514514
threadsToJoin[i].join();
515515
}
516516
Arrays.stream(threadsToJoin).forEach(thread -> assertFalse(thread.isAlive()));
517+
// Monitor the write executor on the data node to try and determine when the backlog of tasks
518+
// has been fully drained (and
519+
// {@link org.elasticsearch.common.util.concurrent.TaskExecutionTimeTrackingEsThreadPoolExecutor.afterExecute()}
520+
// has been called). This is probably not foolproof, so worth investigating if we see non-zero utilization numbers
521+
// after the next poll. See https://github.com/elastic/elasticsearch/issues/134500
522+
assertBusy(() -> assertThat(trackingWriteExecutor.getActiveCount(), equalTo(0)));
517523

518524
assertThat(
519525
"Unexpectedly found a task queued for the write thread pool. Write thread pool dump: " + trackingWriteExecutor,

0 commit comments

Comments
 (0)