Tests often fail because of "dangling" lttng processes left on CI slaves. I am not sure what leaks them (either failing tests or cancelled jobs), but they are a very frequent cause of build failures.
The code is this diff is taken from lttng-tools warn_processes.sh.
We could also clean-up at the end of the job, but I am not sure how to get Jenkins to run a "clean-up" when a job is cancelled (e.g. manually or after a time-out).
# Allow core dumps
ulimit -c unlimited
+ # Kill any LTTng-related process
+ lttng_processes="$("$PGREP" -l 'lttng|gen-ust-.+')"
+ if [ $? -eq 0 ]; then
+ pids="$(cut -d ' ' -f 1 <<< "$lttng_processes" | tr '\n' ' ')"
+ kill -9 $pids
+ fi
+
# Add 'babeltrace' binary to PATH
chmod +x "$BABEL_BINS/babeltrace"
export PATH="$PATH:$BABEL_BINS"