This is an automated email from the ASF dual-hosted git repository.

trohrmann pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new d8ae637  [FLINK-10110][tests] Harden Kafka component shut down for E2E 
tests
d8ae637 is described below

commit d8ae637690b442b0d6ec1c858ad4b3f375a7a449
Author: Till Rohrmann <trohrm...@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

Reply via email to