Skip to content

Commit afea648

Browse files
committed
Improve the trap behaviour of the test scripts.
- Using `-E` with `set` means errors within functions and subshells will be caught by the `trap` + `ERR` combination. - Adding `1 2 3 6` to the `trap` means that the scripts will exit cleanly if you interrupt them, which is useful when testing them locally.
1 parent 67994a8 commit afea648

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ci/check-benchmarks.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

3-
set -e -x;
3+
set -eE -x;
44

55
bash -c "while true; do sleep 30; echo \$(date) - running ...; done" &
66
PING_LOOP_PID=$!
7-
trap 'kill $PING_LOOP_PID' ERR
7+
trap 'kill $PING_LOOP_PID' ERR 1 2 3 6
88

99
# Install a toolchain.
1010
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \

ci/check-profiling.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
# This script only tests some of the profilers at the moment. More coverage
44
# would be nice.
55

6-
set -e -x;
6+
set -eE -x;
77

88
bash -c "while true; do sleep 30; echo \$(date) - running ...; done" &
99
PING_LOOP_PID=$!
10-
trap 'kill $PING_LOOP_PID' ERR
10+
trap 'kill $PING_LOOP_PID' ERR 1 2 3 6
1111

1212
# Install a toolchain.
1313
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \

0 commit comments

Comments
 (0)