run: Use timeout --foreground option.

If timeout doesn't have this option (RHEL 6) don't use timeout at all.

Attempt to fix RHBZ#1025269.
This commit is contained in:
Richard W.M. Jones
2013-12-19 08:21:53 +00:00
parent 05b3aefb8b
commit 6814888774

10
run.in
View File

@@ -219,7 +219,6 @@ fi
# test fails
# - print how long it takes to run the test
# - timeout if the test takes too long to run
# - don't use timeout on RHEL 6 because it's broken (RHBZ#1025269)
# Originally 1h, but that is not long enough to run the C API
# tests on Koji.
@@ -228,9 +227,12 @@ timeout_kill=30s
# Do we have Padraig's timeout utility (from coreutils)?
if timeout --help >/dev/null 2>&1; then
# Does this version of timeout have the -k option? (Not on RHEL 6)
if timeout -k 10s 10s true >/dev/null 2>&1; then
timeout="timeout -k $timeout_kill $timeout_period"
# Must use the --foreground option (RHBZ#1025269).
if timeout --foreground 2 sleep 0 >/dev/null 2>&1; then
# Does this version of timeout have the -k option? (Not on RHEL 6)
if timeout -k 10s 10s true >/dev/null 2>&1; then
timeout="timeout -k $timeout_kill $timeout_period"
fi
fi
fi