diff --git a/e2e/scripts/natsbench.sh b/e2e/scripts/natsbench.sh index c18fc76e..9525b11a 100755 --- a/e2e/scripts/natsbench.sh +++ b/e2e/scripts/natsbench.sh @@ -8,12 +8,12 @@ sleep 1 # This will will all the port-forwarding and delete the stream. We need this to be in a function so we can even call it, # if our tests fails since `set -e` would stop the script in case of an failing test. function cleanup() { - # Forcefully purge the stream. - nats stream purge benchstream -f - # Forcefully delete the stream. - nats stream rm benchstream -f - - kill ${PID} + # Forcefully purge the stream. + nats stream purge benchstream -f + # Forcefully delete the stream. + nats stream rm benchstream -f + + kill ${PID} } # This kills the port-forwards even if the test fails. diff --git a/e2e/scripts/natsserver.sh b/e2e/scripts/natsserver.sh index 08ba443b..c429079c 100755 --- a/e2e/scripts/natsserver.sh +++ b/e2e/scripts/natsserver.sh @@ -12,9 +12,9 @@ PID3=$! # This will will all the port-forwarding. We need this to be in a function so we can even call it, if our tests fails # since `set -e` would stop the script in case of an failing test. function kill_port_forward() { - kill ${PID1} - kill ${PID2} - kill ${PID3} + kill ${PID1} + kill ${PID2} + kill ${PID3} } # This kills the port-forwards even if the test fails. trap kill_port_forward ERR