You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tr...@apache.org on 2018/08/15 19:27:51 UTC
[flink] branch release-1.6 updated: [FLINK-10110][tests] Harden
Kafka component shut down for E2E tests
This is an automated email from the ASF dual-hosted git repository.
trohrmann pushed a commit to branch release-1.6
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.6 by this push:
new 17eeb5a [FLINK-10110][tests] Harden Kafka component shut down for E2E tests
17eeb5a is described below
commit 17eeb5aa665b8fa8ae49e6d7179af67136f377bd
Author: Till Rohrmann <tr...@apache.org>
AuthorDate: Thu Aug 9 11:34:42 2018 +0200
[FLINK-10110][tests] Harden Kafka component shut down for E2E tests
Instead of only calling kafka-server-stop.sh and zookeeper-server-stop.sh which can fail
due to KAFKA-4931 we also use jps to kill the Kafka and ZooKeeper processes.
This closes #6530.
---
flink-end-to-end-tests/test-scripts/kafka-common.sh | 12 ++++++++++++
.../test-scripts/test_confluent_schema_registry.sh | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/flink-end-to-end-tests/test-scripts/kafka-common.sh b/flink-end-to-end-tests/test-scripts/kafka-common.sh
index f0a37b8..26f3f6e 100644
--- a/flink-end-to-end-tests/test-scripts/kafka-common.sh
+++ b/flink-end-to-end-tests/test-scripts/kafka-common.sh
@@ -75,6 +75,18 @@ function start_kafka_cluster {
function stop_kafka_cluster {
$KAFKA_DIR/bin/kafka-server-stop.sh
$KAFKA_DIR/bin/zookeeper-server-stop.sh
+
+ PIDS=$(jps -vl | grep -i 'kafka\.Kafka' | grep java | grep -v grep | awk '{print $1}')
+
+ if [ ! -z "$PIDS" ]; then
+ kill -s TERM $PIDS
+ fi
+
+ PIDS=$(jps -vl | grep java | grep -i QuorumPeerMain | grep -v grep | awk '{print $1}')
+
+ if [ ! -z "$PIDS" ]; then
+ kill -s TERM $PIDS
+ fi
}
function create_kafka_topic {
diff --git a/flink-end-to-end-tests/test-scripts/test_confluent_schema_registry.sh b/flink-end-to-end-tests/test-scripts/test_confluent_schema_registry.sh
index be0b014..323234f 100755
--- a/flink-end-to-end-tests/test-scripts/test_confluent_schema_registry.sh
+++ b/flink-end-to-end-tests/test-scripts/test_confluent_schema_registry.sh
@@ -38,8 +38,8 @@ function test_cleanup {
# don't call ourselves again for normal exit
trap "" EXIT
- stop_kafka_cluster
stop_confluent_schema_registry
+ stop_kafka_cluster
}
trap test_cleanup INT