Skip to content

Commit 9f10766

Browse files
authored
[Test] Allow leader/follower checks in pending tasks (#123841)
Leader and follower checks are expected to run regularly for any multi-node clusters. This PR allows them to be observed in the list of tasks during cleanup phase of REST tests.
1 parent 196e083 commit 9f10766

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

server/src/main/java/org/elasticsearch/cluster/coordination/LeaderChecker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class LeaderChecker {
6060

6161
private static final Logger logger = LogManager.getLogger(LeaderChecker.class);
6262

63-
static final String LEADER_CHECK_ACTION_NAME = "internal:coordination/fault_detection/leader_check";
63+
public static final String LEADER_CHECK_ACTION_NAME = "internal:coordination/fault_detection/leader_check";
6464

6565
// the time between checks sent to the leader
6666
public static final Setting<TimeValue> LEADER_CHECK_INTERVAL_SETTING = Setting.timeSetting(

test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@
134134
import static java.util.Collections.unmodifiableList;
135135
import static org.elasticsearch.client.RestClient.IGNORE_RESPONSE_CODES_PARAM;
136136
import static org.elasticsearch.cluster.ClusterState.VERSION_INTRODUCING_TRANSPORT_VERSIONS;
137+
import static org.elasticsearch.cluster.coordination.FollowersChecker.FOLLOWER_CHECK_ACTION_NAME;
138+
import static org.elasticsearch.cluster.coordination.LeaderChecker.LEADER_CHECK_ACTION_NAME;
137139
import static org.elasticsearch.core.Strings.format;
138140
import static org.elasticsearch.test.MapMatcher.assertMap;
139141
import static org.elasticsearch.test.MapMatcher.matchesMap;
@@ -677,6 +679,8 @@ public static void waitForPendingTasks(final RestClient restClient, final Predic
677679
final String taskName = line.split("\\s+")[0];
678680
if (taskName.startsWith(TransportListTasksAction.TYPE.name())
679681
|| taskName.startsWith(HealthNode.TASK_NAME)
682+
|| taskName.startsWith(LEADER_CHECK_ACTION_NAME)
683+
|| taskName.startsWith(FOLLOWER_CHECK_ACTION_NAME)
680684
|| taskFilter.test(taskName)) {
681685
continue;
682686
}

0 commit comments

Comments
 (0)