Watcher: Remove broken tests (elastic/x-pack-elasticsearch#4399)

These tests test actually watcher 6.x features and are not needed in the
master branch anymore, as there is no way that watcher is running on the
master node only in Elaticsearch 7.x.

Original commit: elastic/x-pack-elasticsearch@ac5b933994
This commit is contained in:
Alexander Reelsen 2018-04-17 23:12:49 +02:00 committed by GitHub
parent 97fa56443d
commit 4c00361b01
2 changed files with 0 additions and 37 deletions

View File

@ -655,20 +655,6 @@ public class WatcherIndexingListenerTests extends ESTestCase {
assertThat(listener.getConfiguration(), is(INACTIVE));
}
public void testThatIndexingListenerIsInactiveWhenWatchExecutionIsNotDistributed() throws Exception {
listener.setConfiguration(INACTIVE);
Version oldVersion = VersionUtils.randomVersionBetween(random(), Version.V_5_6_0, Version.V_6_0_0_alpha2);
DiscoveryNode node = new DiscoveryNode("node_1", ESTestCase.buildNewFakeTransportAddress(), Collections.emptyMap(),
new HashSet<>(asList(DiscoveryNode.Role.values())), oldVersion);
ClusterState state = ClusterState.builder(new ClusterName("my-cluster"))
.nodes(new DiscoveryNodes.Builder().masterNodeId("node_1").localNodeId("node_1").add(node))
.build();
listener.clusterChanged(new ClusterChangedEvent("something", state, state));
assertThat(listener.getConfiguration(), is(INACTIVE));
}
public void testThatIndexingListenerBecomesInactiveWithoutMasterNode() {
ClusterState clusterStateWithMaster = mockClusterState(Watch.INDEX);
ClusterState clusterStateWithoutMaster = mockClusterState(Watch.INDEX);

View File

@ -468,29 +468,6 @@ public class WatcherLifeCycleServiceTests extends ESTestCase {
verify(watcherService, never()).start(any(ClusterState.class));
}
public void testWatcherStartsOnlyOnMasterWhenOldNodesAreInCluster() throws Exception {
DiscoveryNodes nodes = new DiscoveryNodes.Builder()
.masterNodeId("node_1").localNodeId("node_1")
.add(newNode("node_1"))
.add(newNode("node_2"))
.add(newNode("oldNode", VersionUtils.randomVersionBetween(random(), Version.V_5_5_0, Version.V_6_0_0_alpha2)))
.build();
ClusterState state = ClusterState.builder(new ClusterName("my-cluster"))
.nodes(nodes)
.metaData(MetaData.builder()
.put(IndexTemplateMetaData.builder(HISTORY_TEMPLATE_NAME).patterns(randomIndexPatterns()))
.put(IndexTemplateMetaData.builder(TRIGGERED_TEMPLATE_NAME).patterns(randomIndexPatterns()))
.put(IndexTemplateMetaData.builder(WATCHES_TEMPLATE_NAME).patterns(randomIndexPatterns()))
.build())
.build();
when(watcherService.validate(eq(state))).thenReturn(true);
when(watcherService.state()).thenReturn(WatcherState.STOPPED);
lifeCycleService.clusterChanged(new ClusterChangedEvent("any", state, state));
verify(watcherService).start(any(ClusterState.class));
}
public void testWatcherServiceDoesNotStartIfIndexTemplatesAreMissing() throws Exception {
DiscoveryNodes nodes = new DiscoveryNodes.Builder()
.masterNodeId("node_1").localNodeId("node_1")