File tree 1 file changed +16
-15
lines changed
1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- #
3
2
4
- set -e
5
3
source venv/bin/activate
6
4
7
5
librdkafka_version=$( python3 -c ' from confluent_kafka import libversion; print(libversion()[0])' )
@@ -11,22 +9,25 @@ if [[ -z $librdkafka_version ]]; then
11
9
exit 1
12
10
fi
13
11
14
- if [[ -z $STY ]]; then
15
- echo " This script should be run from inside a screen session"
16
- exit 1
17
- fi
18
-
19
12
set -u
20
13
topic=" pysoak-$TESTID -$librdkafka_version "
21
- logfile=" ${topic} .log.bz2"
22
-
23
-
24
- echo " Starting soak client using topic $topic "
14
+ logfile=" ${TESTID} .log.bz2"
15
+ export HOSTNAME=$( hostname)
16
+ echo " Starting soak client using topic $topic . Logging to $logfile ."
25
17
set +x
26
- time confluent-kafka-python/tests/soak/soakclient.py -t $topic -r 80 -f confluent-kafka-python/ccloud.config 2>&1 \
27
- | tee /dev/stderr | bzip2 > $logfile
18
+ # Ignore SIGINT in children (inherited)
19
+ trap " " SIGINT
20
+ time opentelemetry-instrument confluent-kafka-python/tests/soak/soakclient.py -i $TESTID -t $topic -r 80 -f $1 | & tee /dev/tty | bzip2 > $logfile &
21
+ PID=$!
22
+ # On SIGINT kill only the first process of the pipe
23
+ onsigint () {
24
+ # List children of $PID only
25
+ ps --ppid $PID -f | grep soakclient.py | grep -v grep | awk ' {print $2}' | xargs kill
26
+ }
27
+ trap onsigint SIGINT
28
+ # Await the result
29
+ wait $PID
28
30
ret=$?
29
31
echo " Python client exited with status $ret "
32
+ echo " Ending soak client using topic $topic . Logging to $logfile ."
30
33
exit $ret
31
-
32
-
You can’t perform that action at this time.
0 commit comments