summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-10-31 11:54:35 +0100
committerJim Meyering <meyering@redhat.com>2009-11-03 14:14:00 +0100
commit87bf834dd36646f0e413c1afeb5d498079d1bb14 (patch)
treef0138823c9142f39b5a52d20f2adebab8102627e /tests
parent8fe40b84bd8dbb0d1e908422eb68a17c9f254754 (diff)
downloadcoreutils-87bf834dd36646f0e413c1afeb5d498079d1bb14.tar.xz
tests: inotify-race: don't let malfunctioning gdb hang the test
* tests/tail-2/inotify-race: Apply timeout to each gdb invocation.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tail-2/inotify-race16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/tail-2/inotify-race b/tests/tail-2/inotify-race
index 890323988..b1e1a7cc2 100755
--- a/tests/tail-2/inotify-race
+++ b/tests/tail-2/inotify-race
@@ -31,17 +31,17 @@ fi
touch file || framework_failure
touch tail.out || framework_failure
-( gdb --version ) > gdb.out 2>&1
+( timeout 10s gdb --version ) > gdb.out 2>&1
case $(cat gdb.out) in
*'GNU gdb'*) ;;
*) skip_test_ "can't run gdb";;
esac
# See if gdb works:
-gdb -nx --batch-silent \
+timeout 10s gdb -nx --batch-silent \
--eval-command='break tail_forever_inotify' \
- --eval-command='run -f file' \
- --eval-command='quit' \
+ --eval-command='run -f file' \
+ --eval-command='quit' \
tail < /dev/null > gdb.out 2>&1
test -s gdb.out && skip_test_ "can't set breakpoints in tail"
@@ -49,12 +49,12 @@ test -s gdb.out && skip_test_ "can't set breakpoints in tail"
# Run "tail -f file", stopping to append a line just before
# inotify initialization, and then continue. Before the fix,
# that just-appended line would never be output.
-timeout 10s gdb -nx --batch-silent \
+timeout 10s gdb -nx --batch-silent \
--eval-command='break tail_forever_inotify' \
- --eval-command='run -f file >> tail.out' \
+ --eval-command='run -f file >> tail.out' \
--eval-command="shell echo never-seen-with-tail-7.5 >> file" \
- --eval-command='continue' \
- --eval-command='quit' \
+ --eval-command='continue' \
+ --eval-command='quit' \
tail < /dev/null &
pid=$!