提交 2d275e0c 编写于 作者: T Tzu-Li (Gordon) Tai

[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.
上级 ba75bdef
......@@ -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<Tuple2<Integer, String>> source = env.addSource(new SourceSinkDataTestKit.TestDataSourceFunction());
Map<String, String> 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.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册