kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch 0.11.0 updated: Revert "MINOR: Use kill_java_processes when killing ConsoleConsumer in system tests (#5297)"
Date Mon, 02 Jul 2018 16:32:38 GMT
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch 0.11.0
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/0.11.0 by this push:
     new 0d12b58  Revert "MINOR: Use kill_java_processes when killing ConsoleConsumer in system
tests (#5297)"
0d12b58 is described below

commit 0d12b586e90336434e9b1aae5e0559aee44f837c
Author: Jason Gustafson <jason@confluent.io>
AuthorDate: Mon Jul 2 09:32:14 2018 -0700

    Revert "MINOR: Use kill_java_processes when killing ConsoleConsumer in system tests (#5297)"
    
    This reverts commit 530a02a1b3c6959c764eaed797850ba5080e3e1a.
---
 tests/kafkatest/services/console_consumer.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/tests/kafkatest/services/console_consumer.py b/tests/kafkatest/services/console_consumer.py
index a22fbab..312131e 100644
--- a/tests/kafkatest/services/console_consumer.py
+++ b/tests/kafkatest/services/console_consumer.py
@@ -17,6 +17,7 @@ import itertools
 import os
 
 from ducktape.services.background_thread import BackgroundThreadService
+from ducktape.cluster.remoteaccount import RemoteCommandError
 
 from kafkatest.directory_layout.kafka_path import KafkaPathResolverMixin
 from kafkatest.services.monitor.jmx import JmxMixin
@@ -225,7 +226,12 @@ class ConsoleConsumer(KafkaPathResolverMixin, JmxMixin, BackgroundThreadService)
         return cmd
 
     def pids(self, node):
-        return node.account.java_pids(self.java_class_name())
+        try:
+            cmd = "ps ax | grep -i console_consumer | grep java | grep -v grep | awk '{print
$1}'"
+            pid_arr = [pid for pid in node.account.ssh_capture(cmd, allow_fail=True, callback=int)]
+            return pid_arr
+        except (RemoteCommandError, ValueError) as e:
+            return []
 
     def alive(self, node):
         return len(self.pids(node)) > 0
@@ -275,9 +281,7 @@ class ConsoleConsumer(KafkaPathResolverMixin, JmxMixin, BackgroundThreadService)
         BackgroundThreadService.start_node(self, node)
 
     def stop_node(self, node):
-        self.logger.info("%s Stopping node %s" % (self.__class__.__name__, str(node.account)))
-        node.account.kill_java_processes(self.java_class_name(),
-                                         clean_shutdown=True, allow_fail=True)
+        node.account.kill_process("console_consumer", allow_fail=True)
 
         stopped = self.wait_node(node, timeout_sec=self.stop_timeout_sec)
         assert stopped, "Node %s: did not stop within the specified timeout of %s seconds"
% \
@@ -288,13 +292,10 @@ class ConsoleConsumer(KafkaPathResolverMixin, JmxMixin, BackgroundThreadService)
             self.logger.warn("%s %s was still alive at cleanup time. Killing forcefully..."
%
                              (self.__class__.__name__, node.account))
         JmxMixin.clean_node(self, node)
-        node.account.kill_java_processes(self.java_class_name(), clean_shutdown=False, allow_fail=True)
+        node.account.kill_process("java", clean_shutdown=False, allow_fail=True)
         node.account.ssh("rm -rf %s" % ConsoleConsumer.PERSISTENT_ROOT, allow_fail=False)
         self.security_config.clean_node(node)
 
-    def java_class_name(self):
-        return "ConsoleConsumer"
-
     def has_partitions_assigned(self, node):
         if self.new_consumer is False:
             return False


Mime
View raw message