Skip to content

Commit

Permalink
Test reduce flakiness
Browse files Browse the repository at this point in the history
Signed-off-by: Sandesh Kumar <sandeshkr419@gmail.com>
  • Loading branch information
sandeshkr419 committed Mar 28, 2023
1 parent 6dffd09 commit 35327e1
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ public void testNodeRolesWithDataNodeLegacySettings() throws ExecutionException,

// can't start data-only node without assigning cluster-manager
internalCluster().startClusterManagerOnlyNodes(1);
waitForNodes(1);
internalCluster().startNodes(legacyDataNodeSettings);
waitForNodes(total);

Expand All @@ -409,15 +408,11 @@ public void testNodeRolesWithDataNodeLegacySettings() throws ExecutionException,
ClusterStatsResponse clusterStatsResponse = client().admin().cluster().prepareClusterStats().get();
assertCounts(clusterStatsResponse.getNodesStats().getCounts(), total, expectedRoleCounts);

Set<String> expectedClusterManagerOnlyRoles = Set.of(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE.roleName());
assertEquals(expectedClusterManagerOnlyRoles, getNodeRoles(0));

Set<String> expectedDataOnlyNodeRoles = Set.of(
DiscoveryNodeRole.DATA_ROLE.roleName(),
DiscoveryNodeRole.REMOTE_CLUSTER_CLIENT_ROLE.roleName()
Set<Set<String>> expectedNodesRoles = Set.of(
Set.of(DiscoveryNodeRole.CLUSTER_MANAGER_ROLE.roleName()),
Set.of(DiscoveryNodeRole.DATA_ROLE.roleName(), DiscoveryNodeRole.REMOTE_CLUSTER_CLIENT_ROLE.roleName())
);
assertEquals(expectedDataOnlyNodeRoles, getNodeRoles(1));

assertEquals(expectedNodesRoles, Set.of(getNodeRoles(0), getNodeRoles(1)));
}

private Map<String, Integer> getExpectedCounts(
Expand Down

0 comments on commit 35327e1

Please sign in to comment.