File tree Expand file tree Collapse file tree
tests/integration/cases/generic-kafka-function Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ components:
3131 pulsar_manager : false
3232 sql_worker : false
3333 proxy : false
34+ kop : true
3435
3536# # disable monitoring stack
3637monitoring :
Original file line number Diff line number Diff line change @@ -375,12 +375,26 @@ function ci::ensure_kafka_topic() {
375375 topic=$1
376376 kafka_bootstrap_server=$2
377377 properties_file=$3
378+ for attempt in $( seq 1 30) ; do
379+ if kubectl exec -n ${NAMESPACE} kafka-client -- kafka-topics.sh \
380+ --bootstrap-server " ${kafka_bootstrap_server} " \
381+ --command-config " /opt/bitnami/kafka/config/${properties_file} " \
382+ --list > /dev/null 2>&1 ; then
383+ break
384+ fi
385+ if [ " ${attempt} " -eq 30 ]; then
386+ echo " Kafka broker ${kafka_bootstrap_server} is not ready"
387+ kubectl get pods -n ${NAMESPACE} -o wide || true
388+ return 1
389+ fi
390+ sleep 5
391+ done
378392 kubectl exec -n ${NAMESPACE} kafka-client -- kafka-topics.sh \
379393 --bootstrap-server " ${kafka_bootstrap_server} " \
380394 --create \
381395 --if-not-exists \
382396 --topic " ${topic} " \
383- --command-config " /opt/bitnami/kafka/config/${properties_file} " || true
397+ --command-config " /opt/bitnami/kafka/config/${properties_file} "
384398}
385399
386400function ci::verify_kafka_exclamation_function() {
Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ kubectl wait pod kafka-client --for=condition=Ready --timeout=2m || {
4848 exit 1
4949}
5050
51- ci::ensure_kafka_topic " ${input_topic} " " ${kafka_bootstrap_server} " " ${kafka_properties_file} " > /dev/null 2>&1
52- ci::ensure_kafka_topic " ${output_topic} " " ${kafka_bootstrap_server} " " ${kafka_properties_file} " > /dev/null 2>&1
51+ ci::ensure_kafka_topic " ${input_topic} " " ${kafka_bootstrap_server} " " ${kafka_properties_file} "
52+ ci::ensure_kafka_topic " ${output_topic} " " ${kafka_bootstrap_server} " " ${kafka_properties_file} "
5353kubectl apply -f " ${manifests_file} " > /dev/null 2>&1
5454
5555kubectl wait -l compute.functionmesh.io/name=generic-kafka-function --for=condition=Ready pod --timeout=2m || {
You can’t perform that action at this time.
0 commit comments