Skip to content

Commit

Permalink
Fix timeout in Kafka test
Browse files Browse the repository at this point in the history
Instead of waiting for some time and then check whether messages have
been consumed, this fix waits for exactly one message to be consumed.
Additionally, a timeout of 30s ist set to not wait forever in case of
a failing test.
  • Loading branch information
SoerenHenning committed Apr 12, 2021
1 parent c687428 commit 6785887
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion charts/cp-kafka/templates/tests/canary-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ spec:
# Produce a test message to the topic
echo "$MESSAGE" | kafka-console-producer --broker-list {{ template "cp-kafka.fullname" . }}:9092 --topic {{ template "cp-kafka.fullname" . }}-canary-topic && \
# Consume a test message from the topic
kafka-console-consumer --bootstrap-server {{ template "cp-kafka.fullname" . }}-headless:9092 --topic {{ template "cp-kafka.fullname" . }}-canary-topic --from-beginning --timeout-ms 2000 | grep "$MESSAGE"
kafka-console-consumer --bootstrap-server {{ template "cp-kafka.fullname" . }}-headless:9092 --topic {{ template "cp-kafka.fullname" . }}-canary-topic --from-beginning --max-messages 1 --timeout-ms 30000 | grep "$MESSAGE"
restartPolicy: Never

0 comments on commit 6785887

Please sign in to comment.