Skip to content

Commit 3c2ded6

Browse files
committed
correct python code
1 parent f1ffdff commit 3c2ded6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/lib/eventproducer_connector_upgrade.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ def check_events_from_topic(target):
3131
time.sleep(5)
3232
while time.time() < t_end:
3333
kafka_version_flag = os.environ.get("CI_KAFKA_VERSION_BEFORE_3_7")
34-
if kafka_version_flag:
34+
if kafka_version_flag == "true":
3535
class_name = "kafka.tools.GetOffsetShell"
3636
else:
3737
class_name = "org.apache.kafka.tools.GetOffsetShell"
38-
output1 = subprocess.getoutput(f"echo $(/usr/local/kafka/bin/kafka-run-class.sh {class_name} --broker-list 'localhost:9092' --topic kafka_connect_upgrade --time -1 | grep -e ':[[:digit:]]*:' | awk -F ':' '{sum += $3} END {print sum}')")
39-
output2 = subprocess.getoutput(f"echo $(/usr/local/kafka/bin/kafka-run-class.sh {class_name} --broker-list 'localhost:9092' --topic kafka_connect_upgrade --time -2 | grep -e ':[[:digit:]]*:' | awk -F ':' '{sum += $3} END {print sum}')")
38+
output1 = subprocess.getoutput(f"echo $(/usr/local/kafka/bin/kafka-run-class.sh {class_name} --broker-list 'localhost:9092' --topic kafka_connect_upgrade --time -1"
39+
+ " | grep -e ':[[:digit:]]*:' | awk -F ':' '{sum += $3} END {print sum}')")
40+
output2 = subprocess.getoutput(f"echo $(/usr/local/kafka/bin/kafka-run-class.sh {class_name} --broker-list 'localhost:9092' --topic kafka_connect_upgrade --time -2"
41+
+ " | grep -e ':[[:digit:]]*:' | awk -F ':' '{sum += $3} END {print sum}')")
4042
time.sleep(5)
4143
if (int(output1)-int(output2))==target:
4244
logger.info("Events in the topic :" + str(int(output1)-int(output2)))

0 commit comments

Comments
 (0)