Skip to content

Commit 46ce911

Browse files
Stabilize CancellableTasksIT#testRemoveBanParentsOnDisconnect (#131858)
Ensure that the cluster has a stably elected master node when the test completes so that the post-test tear-down check for cluster state consistency can succeed. Closes #131562
1 parent 70f4e7c commit 46ce911

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,6 @@ tests:
449449
- class: org.elasticsearch.xpack.search.CrossClusterAsyncSearchIT
450450
method: testCancellationViaTimeoutWithAllowPartialResultsSetToFalse
451451
issue: https://github.com/elastic/elasticsearch/issues/131248
452-
- class: org.elasticsearch.action.admin.cluster.node.tasks.CancellableTasksIT
453-
method: testRemoveBanParentsOnDisconnect
454-
issue: https://github.com/elastic/elasticsearch/issues/131562
455452
- class: org.elasticsearch.xpack.esql.action.CrossClusterQueryWithPartialResultsIT
456453
method: testPartialResults
457454
issue: https://github.com/elastic/elasticsearch/issues/131481

server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/node/tasks/CancellableTasksIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ public void testRemoveBanParentsOnDisconnect() throws Exception {
363363
allowEntireRequest(rootRequest);
364364
cancelFuture.actionGet();
365365
ensureBansAndCancellationsConsistency();
366+
// This method will call the cluster health API with wait_for_tasks set to Priority#LANGUID. This will ensure that all tasks
367+
// currently submitted to the master service (included re-election after a disconnect) are processed before returning. This
368+
// ensures cluster stability for the post-test consistency checks.
369+
ensureStableCluster(nodes.size());
366370
}
367371
}
368372

0 commit comments

Comments
 (0)