File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
server/src/test/java/org/elasticsearch/cluster/coordination Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 42
42
43
43
@ TestLogging (reason = "these tests do a lot of log-worthy things but we usually don't care" , value = "org.elasticsearch:FATAL" )
44
44
public class AtomicRegisterCoordinatorTests extends CoordinatorTests {
45
- @ Override
46
- @ AwaitsFix (bugUrl = "ES-5645" )
47
- public void testUnhealthyNodesGetsRemoved () {
48
- // This test checks that the voting configuration shrinks after a node is removed from the cluster
49
- // TODO: rewrite this test without taking into account the final voting configuration
50
- }
51
-
52
45
@ Override
53
46
@ AwaitsFix (bugUrl = "ES-5645" )
54
47
public void testLeaderDisconnectionWithDisconnectEventDetectedQuickly () {
@@ -147,6 +140,12 @@ public void testCannotJoinClusterWithDifferentUUID() {
147
140
// TODO: add more checks to avoid forming a mixed cluster between register based and traditional clusters
148
141
}
149
142
143
+ @ Override
144
+ public void testUnhealthyNodesGetsRemoved () {
145
+ // the test still applies with an atomic register, except for the assertions about the voting configuration
146
+ testUnhealthyNodesGetsRemoved (false );
147
+ }
148
+
150
149
@ Override
151
150
public void testJoiningNodeReceivesFullState () {
152
151
try (Cluster cluster = new Cluster (randomIntBetween (1 , 5 ))) {
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ public void testDoesNotElectNonMasterNode() {
123
123
}
124
124
125
125
public void testUnhealthyNodesGetsRemoved () {
126
+ testUnhealthyNodesGetsRemoved (true );
127
+ }
128
+
129
+ protected void testUnhealthyNodesGetsRemoved (boolean verifyVotingConfiguration ) {
126
130
AtomicReference <StatusInfo > healthStatusInfo = new AtomicReference <>(new StatusInfo (HEALTHY , "healthy-info" ));
127
131
try (Cluster cluster = new Cluster (3 )) {
128
132
cluster .runRandomly ();
@@ -148,7 +152,7 @@ public void testUnhealthyNodesGetsRemoved() {
148
152
+ 2 * 2 * DEFAULT_CLUSTER_STATE_UPDATE_DELAY
149
153
);
150
154
151
- {
155
+ if ( verifyVotingConfiguration ) {
152
156
assertThat (leader .coordinator .getMode (), is (Mode .LEADER ));
153
157
final VotingConfiguration lastCommittedConfiguration = leader .getLastAppliedClusterState ().getLastCommittedConfiguration ();
154
158
assertThat (
@@ -190,7 +194,8 @@ public void testUnhealthyNodesGetsRemoved() {
190
194
// then wait for the followup reconfiguration
191
195
+ DEFAULT_CLUSTER_STATE_UPDATE_DELAY
192
196
);
193
- {
197
+
198
+ if (verifyVotingConfiguration ) {
194
199
final ClusterNode newLeader = cluster .getAnyLeader ();
195
200
final VotingConfiguration lastCommittedConfiguration = newLeader .getLastAppliedClusterState ()
196
201
.getLastCommittedConfiguration ();
You can’t perform that action at this time.
0 commit comments