mirror of
https://github.com/systemd/systemd.git
synced 2025-03-09 12:58:26 +03:00
travis: use double the normal timeout in the ASan & UBSan stage
This should somewhat address https://github.com/systemd/systemd/issues/10696.
This commit is contained in:
parent
b5be61d1ed
commit
d419b75ce9
@ -23,6 +23,8 @@ function info() {
|
||||
|
||||
set -e
|
||||
|
||||
source "$(dirname $0)/travis_wait.bash"
|
||||
|
||||
for phase in "${PHASES[@]}"; do
|
||||
case $phase in
|
||||
SETUP)
|
||||
@ -55,7 +57,7 @@ for phase in "${PHASES[@]}"; do
|
||||
$DOCKER_EXEC ninja -v -C build
|
||||
|
||||
# Never remove halt_on_error from UBSAN_OPTIONS. See https://github.com/systemd/systemd/commit/2614d83aa06592aedb.
|
||||
$DOCKER_EXEC sh -c "UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1 meson test --timeout-multiplier=3 -C ./build/ --print-errorlogs"
|
||||
travis_wait docker exec --interactive=false -t $CONT_NAME sh -c "UBSAN_OPTIONS=print_stacktrace=1:print_summary=1:halt_on_error=1 meson test --timeout-multiplier=3 -C ./build/ --print-errorlogs"
|
||||
;;
|
||||
CLEANUP)
|
||||
info "Cleanup phase"
|
||||
|
59
travis-ci/managers/travis_wait.bash
Normal file
59
travis-ci/managers/travis_wait.bash
Normal file
@ -0,0 +1,59 @@
|
||||
# This was borrowed from https://github.com/travis-ci/travis-build/tree/master/lib/travis/build/bash
|
||||
# to get around https://github.com/travis-ci/travis-ci/issues/9979. It should probably be removed
|
||||
# as soon as Travis CI has started to provide an easy way to export the functions to bash scripts.
|
||||
|
||||
travis_jigger() {
|
||||
local cmd_pid="${1}"
|
||||
shift
|
||||
local timeout="${1}"
|
||||
shift
|
||||
local count=0
|
||||
|
||||
echo -e "\\n"
|
||||
|
||||
while [[ "${count}" -lt "${timeout}" ]]; do
|
||||
count="$((count + 1))"
|
||||
echo -ne "Still running (${count} of ${timeout}): ${*}\\r"
|
||||
sleep 60
|
||||
done
|
||||
|
||||
echo -e "\\n${ANSI_RED}Timeout (${timeout} minutes) reached. Terminating \"${*}\"${ANSI_RESET}\\n"
|
||||
kill -9 "${cmd_pid}"
|
||||
}
|
||||
|
||||
travis_wait() {
|
||||
local timeout="${1}"
|
||||
|
||||
if [[ "${timeout}" =~ ^[0-9]+$ ]]; then
|
||||
shift
|
||||
else
|
||||
timeout=20
|
||||
fi
|
||||
|
||||
local cmd=("${@}")
|
||||
local log_file="travis_wait_${$}.log"
|
||||
|
||||
"${cmd[@]}" &>"${log_file}" &
|
||||
local cmd_pid="${!}"
|
||||
|
||||
travis_jigger "${!}" "${timeout}" "${cmd[@]}" &
|
||||
local jigger_pid="${!}"
|
||||
local result
|
||||
|
||||
{
|
||||
wait "${cmd_pid}" 2>/dev/null
|
||||
result="${?}"
|
||||
ps -p"${jigger_pid}" &>/dev/null && kill "${jigger_pid}"
|
||||
}
|
||||
|
||||
if [[ "${result}" -eq 0 ]]; then
|
||||
echo -e "\\n${ANSI_GREEN}The command ${cmd[*]} exited with ${result}.${ANSI_RESET}"
|
||||
else
|
||||
echo -e "\\n${ANSI_RED}The command ${cmd[*]} exited with ${result}.${ANSI_RESET}"
|
||||
fi
|
||||
|
||||
echo -e "\\n${ANSI_GREEN}Log:${ANSI_RESET}\\n"
|
||||
cat "${log_file}"
|
||||
|
||||
return "${result}"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user