From 11feb2dbad6d24f86d30306a0b0da0a84e937878 Mon Sep 17 00:00:00 2001 From: Chia-Ping Tsai Date: Thu, 11 Mar 2021 02:09:20 +0800 Subject: [PATCH 1/4] MINOR: fix client_compatibility_features_test.py --- .../client/client_compatibility_features_test.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/kafkatest/tests/client/client_compatibility_features_test.py b/tests/kafkatest/tests/client/client_compatibility_features_test.py index d98dffa3b8549..6cd69fa374a6b 100644 --- a/tests/kafkatest/tests/client/client_compatibility_features_test.py +++ b/tests/kafkatest/tests/client/client_compatibility_features_test.py @@ -81,8 +81,12 @@ def __init__(self, test_context): self.kafka = KafkaService(test_context, num_nodes=3, zk=self.zk, topics=self.topics) def invoke_compatibility_program(self, features): - # Run the compatibility test on the first Kafka node. - node = self.kafka.nodes[0] + if self.zk: + # kafka nodes are set to older version so resolved script path is linked to older assembly. + # run the compatibility test on the first zk node to get script path linked to latest(dev) assembly. + node = self.zk.nodes[0] + else: + node = self.kafka.nodes[0] cmd = ("%s org.apache.kafka.tools.ClientCompatibilityTest " "--bootstrap-server %s " "--num-cluster-nodes %d " @@ -130,4 +134,7 @@ def run_compatibility_test(self, broker_version, metadata_quorum=quorum.zk): self.kafka.set_version(KafkaVersion(broker_version)) self.kafka.start() features = get_broker_features(broker_version) + if not self.zk: + # this is supported by zkBroker currently + features["describe-acls-supported"] = False self.invoke_compatibility_program(features) From 55197e72600cb2b5c0994cfdeabced992d264e58 Mon Sep 17 00:00:00 2001 From: Chia-Ping Tsai Date: Fri, 12 Mar 2021 11:32:53 +0800 Subject: [PATCH 2/4] polish comments --- .../tests/client/client_compatibility_features_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/kafkatest/tests/client/client_compatibility_features_test.py b/tests/kafkatest/tests/client/client_compatibility_features_test.py index 6cd69fa374a6b..a4e4e8d667e7a 100644 --- a/tests/kafkatest/tests/client/client_compatibility_features_test.py +++ b/tests/kafkatest/tests/client/client_compatibility_features_test.py @@ -135,6 +135,7 @@ def run_compatibility_test(self, broker_version, metadata_quorum=quorum.zk): self.kafka.start() features = get_broker_features(broker_version) if not self.zk: - # this is supported by zkBroker currently + # this check/disabling is only necessary due to the fact that we are in early access mode with + # KIP-500 and we should remove the special casing when that his fully implemented features["describe-acls-supported"] = False self.invoke_compatibility_program(features) From a15166bc8fcdf6e2bb5d8282316668af2ba0b8a7 Mon Sep 17 00:00:00 2001 From: Chia-Ping Tsai Date: Wed, 17 Mar 2021 10:21:41 +0800 Subject: [PATCH 3/4] address review comment --- .../client/client_compatibility_features_test.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/kafkatest/tests/client/client_compatibility_features_test.py b/tests/kafkatest/tests/client/client_compatibility_features_test.py index a4e4e8d667e7a..d74da68349062 100644 --- a/tests/kafkatest/tests/client/client_compatibility_features_test.py +++ b/tests/kafkatest/tests/client/client_compatibility_features_test.py @@ -79,18 +79,16 @@ def __init__(self, test_context): "replication-factor": 3 }} self.kafka = KafkaService(test_context, num_nodes=3, zk=self.zk, topics=self.topics) + # Always use the latest version of org.apache.kafka.tools.ClientCompatibilityTest + # so store away the path to the DEV version before we set the Kafka version + self.dev_script_path = self.kafka.path.script("kafka-run-class.sh", self.kafka.nodes[0]) def invoke_compatibility_program(self, features): - if self.zk: - # kafka nodes are set to older version so resolved script path is linked to older assembly. - # run the compatibility test on the first zk node to get script path linked to latest(dev) assembly. - node = self.zk.nodes[0] - else: - node = self.kafka.nodes[0] + node = self.kafka.nodes[0] cmd = ("%s org.apache.kafka.tools.ClientCompatibilityTest " "--bootstrap-server %s " "--num-cluster-nodes %d " - "--topic %s " % (self.kafka.path.script("kafka-run-class.sh", node), + "--topic %s " % (self.dev_script_path, self.kafka.bootstrap_servers(), len(self.kafka.nodes), list(self.topics.keys())[0])) From f541425c7c6131324353aaa0f288c6c56dac9311 Mon Sep 17 00:00:00 2001 From: Chia-Ping Tsai Date: Wed, 17 Mar 2021 22:43:53 +0800 Subject: [PATCH 4/4] restore useful comment --- .../kafkatest/tests/client/client_compatibility_features_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/kafkatest/tests/client/client_compatibility_features_test.py b/tests/kafkatest/tests/client/client_compatibility_features_test.py index d74da68349062..e04c65e4fed7a 100644 --- a/tests/kafkatest/tests/client/client_compatibility_features_test.py +++ b/tests/kafkatest/tests/client/client_compatibility_features_test.py @@ -84,6 +84,7 @@ def __init__(self, test_context): self.dev_script_path = self.kafka.path.script("kafka-run-class.sh", self.kafka.nodes[0]) def invoke_compatibility_program(self, features): + # Run the compatibility test on the first Kafka node. node = self.kafka.nodes[0] cmd = ("%s org.apache.kafka.tools.ClientCompatibilityTest " "--bootstrap-server %s "