Skip to content

Commit eae58c4

Browse files
committed
Remove testNodeFailuresAreProcessedOnce
This test was not checking the thing it was supposed to anyway.
1 parent 250973a commit eae58c4

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

server/src/test/java/org/elasticsearch/cluster/coordination/ZenDiscoveryIT.java

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,14 @@
4242
import org.elasticsearch.test.junit.annotations.TestLogging;
4343
import org.elasticsearch.transport.RemoteTransportException;
4444

45-
import java.io.IOException;
4645
import java.util.EnumSet;
4746
import java.util.Optional;
4847
import java.util.concurrent.CompletableFuture;
49-
import java.util.concurrent.CountDownLatch;
5048
import java.util.concurrent.ExecutionException;
5149
import java.util.concurrent.TimeUnit;
5250
import java.util.concurrent.TimeoutException;
53-
import java.util.concurrent.atomic.AtomicInteger;
5451

5552
import static org.hamcrest.Matchers.containsString;
56-
import static org.hamcrest.Matchers.either;
5753
import static org.hamcrest.Matchers.equalTo;
5854
import static org.hamcrest.Matchers.is;
5955
import static org.hamcrest.Matchers.not;
@@ -105,45 +101,6 @@ public void testNoShardRelocationsOccurWhenElectedMasterNodeFails() throws Excep
105101
assertThat(numRecoveriesAfterNewMaster, equalTo(numRecoveriesBeforeNewMaster));
106102
}
107103

108-
public void testNodeFailuresAreProcessedOnce() throws IOException {
109-
Settings defaultSettings = Settings.builder()
110-
.put(FaultDetection.PING_TIMEOUT_SETTING.getKey(), "1s")
111-
.put(FaultDetection.PING_RETRIES_SETTING.getKey(), "1")
112-
.build();
113-
114-
Settings masterNodeSettings = Settings.builder()
115-
.put(Node.NODE_DATA_SETTING.getKey(), false)
116-
.put(defaultSettings)
117-
.build();
118-
String master = internalCluster().startNode(masterNodeSettings);
119-
Settings dateNodeSettings = Settings.builder()
120-
.put(Node.NODE_MASTER_SETTING.getKey(), false)
121-
.put(defaultSettings)
122-
.build();
123-
internalCluster().startNodes(2, dateNodeSettings);
124-
client().admin().cluster().prepareHealth().setWaitForNodes("3").get();
125-
126-
ClusterService clusterService = internalCluster().getInstance(ClusterService.class, master);
127-
final AtomicInteger numUpdates = new AtomicInteger();
128-
final CountDownLatch nodesStopped = new CountDownLatch(1);
129-
clusterService.addStateApplier(event -> {
130-
numUpdates.incrementAndGet();
131-
try {
132-
// block until both nodes have stopped to accumulate node failures
133-
nodesStopped.await();
134-
} catch (InterruptedException e) {
135-
//meh
136-
}
137-
});
138-
139-
internalCluster().stopRandomNonMasterNode();
140-
internalCluster().stopRandomNonMasterNode();
141-
nodesStopped.countDown();
142-
143-
client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).get(); // wait for all to be processed
144-
assertThat(numUpdates.get(), either(equalTo(1)).or(equalTo(2))); // due to batching, both nodes can be handled in same CS update
145-
}
146-
147104
public void testHandleNodeJoin_incompatibleClusterState()
148105
throws InterruptedException, ExecutionException, TimeoutException {
149106
String masterNode = internalCluster().startMasterOnlyNode();

0 commit comments

Comments
 (0)