]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: inotify-race: don't let malfunctioning gdb hang the test
authorJim Meyering <meyering@redhat.com>
Sat, 31 Oct 2009 10:54:35 +0000 (11:54 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 3 Nov 2009 13:14:00 +0000 (14:14 +0100)
* tests/tail-2/inotify-race: Apply timeout to each gdb invocation.

tests/tail-2/inotify-race

index 890323988c07b89629760b81b7e1ec16b3365250..b1e1a7cc2eff78c343b3ed7fd946d3d0d3eba34c 100755 (executable)
@@ -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=$!