Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/run_integration_group.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test_group_sql() {

test_group_pulsar_io() {
mvn_run_integration_test --no-retry "$@" -DintegrationTestSuiteFile=pulsar-io-sources.xml -DintegrationTests -Dgroups=source
#mvn_run_integration_test --no-retry "$@" -DintegrationTestSuiteFile=pulsar-io-sinks.xml -DintegrationTests -Dgroups=sink
mvn_run_integration_test --no-retry "$@" -DintegrationTestSuiteFile=pulsar-io-sinks.xml -DintegrationTests -Dgroups=sink
}

test_group_pulsar_io_ora() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class ElasticSearchContainer extends ChaosContainer<ElasticSearchContaine
static final Integer[] PORTS = { 9200, 9300 };

public static final String IMAGE_NAME = Optional.ofNullable(System.getenv("ELASTICSEARCH_IMAGE"))
.orElse("docker.elastic.co/elasticsearch/elasticsearch:7.13.3");
.orElse("docker.elastic.co/elasticsearch/elasticsearch:7.15.0");

public ElasticSearchContainer(String clusterName) {
super(clusterName, IMAGE_NAME);
Expand All @@ -40,6 +40,7 @@ protected void configure() {
this.withNetworkAliases(NAME)
.withExposedPorts(PORTS)
.withEnv("discovery.type", "single-node")
.withEnv("ES_JAVA_OPTS", "-Xms2g -Xmx2g")
.withCreateContainerCmdModifier(createContainerCmd -> {
createContainerCmd.withHostName(NAME);
createContainerCmd.withName(clusterName + "-" + NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;

import java.io.IOException;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

import lombok.AllArgsConstructor;
import lombok.Cleanup;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpHost;
import org.apache.pulsar.client.api.Producer;
import org.apache.pulsar.client.api.PulsarClient;
Expand All @@ -45,6 +47,7 @@
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

@Slf4j
public class ElasticSearchSinkTester extends SinkTester<ElasticSearchContainer> {

private RestHighLevelClient elasticClient;
Expand Down Expand Up @@ -104,6 +107,19 @@ public void prepareSink() throws Exception {
elasticClient = new RestHighLevelClient(builder);
}

@Override
public void stopServiceContainer(PulsarCluster cluster) {
try {
if (elasticClient != null) {
elasticClient.close();
}
} catch (IOException e) {
log.warn("Error closing elasticClient, ignoring", e);
} finally {
super.stopServiceContainer(cluster);
}
}

@Override
public void validateSinkResult(Map<String, String> kvs) {
SearchRequest searchRequest = new SearchRequest("test-index");
Expand Down