mirror of https://github.com/mongodb/mongo
SERVER-113297 Apply s390x/ppc timeout multiplier to test wrapper (#43403)
GitOrigin-RevId: 941da63dd3e2cfa93dfba90e63462304efe6b3a7
This commit is contained in:
parent
0a38d039a1
commit
3828ad5e6a
|
|
@ -1,17 +1,43 @@
|
|||
#!/bin/bash
|
||||
|
||||
is_ppc64le() {
|
||||
local -r arch="$(uname -m)"
|
||||
[[ "${arch}" == "ppc64le" || "${arch}" == "ppc64" || "${arch}" == "ppc" ]] && return 0 || return 1
|
||||
}
|
||||
|
||||
is_s390x() {
|
||||
local -r arch="$(uname -m)"
|
||||
[[ "${arch}" == "s390x" || "${arch}" == "s390" ]] && return 0 || return 1
|
||||
}
|
||||
|
||||
is_s390x_or_ppc64le() {
|
||||
if is_ppc64le || is_s390x; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
ulimit -c unlimited
|
||||
|
||||
eval ${@:1} &
|
||||
main_pid=$!
|
||||
echo "Process-under-test started with PID: ${main_pid}"
|
||||
|
||||
timeout_seconds=600
|
||||
|
||||
if is_s390x_or_ppc64le; then
|
||||
timeout_seconds=$((timeout_seconds * 4))
|
||||
fi
|
||||
|
||||
timeout_minutes=$((timeout_seconds / 60))
|
||||
|
||||
(
|
||||
sleep 600
|
||||
sleep $timeout_seconds
|
||||
|
||||
# 'kill -0' checks for process existence without sending a signal
|
||||
if kill -0 "$main_pid" 2>/dev/null; then
|
||||
echo "10 minute Timer finished. Process-under-test ${main_pid} is still running. Sending a SIGABRT to trigger a coredump now."
|
||||
echo "${timeout_minutes} minute Timer finished. Process-under-test ${main_pid} is still running. Sending a SIGABRT to trigger a coredump now."
|
||||
kill -ABRT "${main_pid}"
|
||||
fi
|
||||
) &
|
||||
|
|
|
|||
Loading…
Reference in New Issue