From 2d275e0c26b6e9b13df89450e7ff6291cae5bede Mon Sep 17 00:00:00 2001 From: "Tzu-Li (Gordon) Tai" Date: Tue, 27 Jun 2017 16:40:51 +0800 Subject: [PATCH] [FLINK-6867] [elasticsearch] Fix instable Elasticsearch 1.x ITCases The root cause for the instability in ES 1.x is that we're testing both embedded client mode and transport client mode against the same Elasticsearch environment. This commit removes the embedded mode testing, as that method is generally discouraged anyways. This closes #4191. --- .../ElasticsearchSinkITCase.java | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/flink-connectors/flink-connector-elasticsearch/src/test/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchSinkITCase.java b/flink-connectors/flink-connector-elasticsearch/src/test/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchSinkITCase.java index 1fcfa2efb5f..3772f02eba1 100644 --- a/flink-connectors/flink-connector-elasticsearch/src/test/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchSinkITCase.java +++ b/flink-connectors/flink-connector-elasticsearch/src/test/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchSinkITCase.java @@ -65,37 +65,6 @@ public class ElasticsearchSinkITCase extends ElasticsearchSinkTestBase { // -- Tests specific to Elasticsearch 1.x -- - /** - * Tests that the Elasticsearch sink works properly using an embedded node to connect to Elasticsearch. - */ - @Test - public void testEmbeddedNode() throws Exception { - final String index = "embedded-node-test-index"; - - final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); - - DataStreamSource> source = env.addSource(new SourceSinkDataTestKit.TestDataSourceFunction()); - - Map userConfig = new HashMap<>(); - // This instructs the sink to emit after every element, otherwise they would be buffered - userConfig.put(ElasticsearchSinkBase.CONFIG_KEY_BULK_FLUSH_MAX_ACTIONS, "1"); - userConfig.put("cluster.name", CLUSTER_NAME); - userConfig.put("node.local", "true"); - - source.addSink(new ElasticsearchSink<>( - userConfig, - new SourceSinkDataTestKit.TestElasticsearchSinkFunction(index)) - ); - - env.execute("Elasticsearch Embedded Node Test"); - - // verify the results - Client client = embeddedNodeEnv.getClient(); - SourceSinkDataTestKit.verifyProducedSinkData(client, index); - - client.close(); - } - /** * Tests that behaviour of the deprecated {@link IndexRequestBuilder} constructor works properly. */ -- GitLab