summaryrefslogtreecommitdiffstats
path: root/src/fluent-bit/lib/librdkafka-2.1.0/tests/until-fail.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:18 +0000
commit5da14042f70711ea5cf66e034699730335462f66 (patch)
tree0f6354ccac934ed87a2d555f45be4c831cf92f4a /src/fluent-bit/lib/librdkafka-2.1.0/tests/until-fail.sh
parentReleasing debian version 1.44.3-2. (diff)
downloadnetdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz
netdata-5da14042f70711ea5cf66e034699730335462f66.zip
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fluent-bit/lib/librdkafka-2.1.0/tests/until-fail.sh')
-rwxr-xr-xsrc/fluent-bit/lib/librdkafka-2.1.0/tests/until-fail.sh87
1 files changed, 87 insertions, 0 deletions
diff --git a/src/fluent-bit/lib/librdkafka-2.1.0/tests/until-fail.sh b/src/fluent-bit/lib/librdkafka-2.1.0/tests/until-fail.sh
new file mode 100755
index 000000000..48cbecb0c
--- /dev/null
+++ b/src/fluent-bit/lib/librdkafka-2.1.0/tests/until-fail.sh
@@ -0,0 +1,87 @@
+#!/bin/bash
+#
+#
+# Run tests, one by one, until a failure.
+#
+# Usage:
+# ./until-fail.sh [test-runner args] [mode]
+#
+# mode := bare valgrind helgrind gdb ..
+#
+# Logs for the last test run is written to _until-fail_<PID>.log.
+#
+
+[[ -z "$DELETE_TOPICS" ]] && DELETE_TOPICS=y
+
+if [[ -z $ZK_ADDRESS ]]; then
+ ZK_ADDRESS="localhost"
+fi
+
+set -e
+set -o pipefail # to have 'run-test.sh | tee' fail if run-test.sh fails.
+
+ARGS=
+while [[ $1 == -* ]]; do
+ ARGS="$ARGS $1"
+ shift
+done
+
+modes=$*
+if [[ -z "$modes" ]]; then
+ modes="valgrind"
+fi
+
+if [[ -z "$TESTS" ]]; then
+ tests=$(echo 0???-*.c 0???-*.cpp)
+else
+ tests="$TESTS"
+fi
+
+if [[ $modes != gdb ]]; then
+ ARGS="-p1 $ARGS"
+fi
+
+LOG_FILE="_until_fail_$$.log"
+
+iter=0
+while true ; do
+ iter=$(expr $iter + 1)
+
+ for t in $tests ; do
+ # Strip everything after test number (0001-....)
+ t=$(echo $t | cut -d- -f1)
+
+ for mode in $modes ; do
+
+ echo "##################################################"
+ echo "##################################################"
+ echo "############ Test iteration $iter ################"
+ echo "############ Test $t in mode $mode ###############"
+ echo "##################################################"
+ echo "##################################################"
+
+ if [[ $t == all ]]; then
+ unset TESTS
+ else
+ export TESTS=$t
+ fi
+ (./run-test.sh $ARGS $mode 2>&1 | tee $LOG_FILE) || (echo "Failed on iteration $iter, test $t, mode $mode, logs in $LOG_FILE" ; exit 1)
+ done
+ done
+
+
+ if [[ "$DELETE_TOPICS" == "y" ]]; then
+ # Delete topics using Admin API, which is very fast
+ # leads to sub-sequent test failures because of the background
+ # deletes in Kafka still taking a long time:
+ #
+ #make delete_topics
+
+ # Delete topic-by-topic using kafka-topics for each one,
+ # very slow but topics are properly deleted before the script
+ # returns.
+ ./delete-test-topics.sh $ZK_ADDRESS || true
+ fi
+done
+
+