diff options
author | Jim Meyering <jim@meyering.net> | 2003-09-05 07:56:39 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-09-05 07:56:39 +0000 |
commit | df4a189e233871c208204c143827518e255df544 (patch) | |
tree | 54ba7593e0937f3101f39cdb8672e72ef458feb9 /tests/tail-2/tail-n0f | |
parent | 23181a481db6d956cbb0083c64da6a4ff6aa0ef9 (diff) | |
download | coreutils-df4a189e233871c208204c143827518e255df544.tar.xz |
Wait .5 seconds for backgrounded process
to start, rather than just .1. Upon failure, print unexpected state.
Diffstat (limited to 'tests/tail-2/tail-n0f')
-rwxr-xr-x | tests/tail-2/tail-n0f | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/tail-2/tail-n0f b/tests/tail-2/tail-n0f index d13db9927..3e78fb2ff 100755 --- a/tests/tail-2/tail-n0f +++ b/tests/tail-2/tail-n0f @@ -12,7 +12,7 @@ fi sleep 2 & pid=$! -sleep .1 +sleep .5 grep '^State:[ ]*[S]' /proc/$pid/status > /dev/null 2>&1 || \ { echo "$0:/proc/$pid/status: missing or 'different': skipping this test" 1>&2 @@ -42,8 +42,14 @@ for file in empty nonempty; do for c_or_n in c n; do tail --sleep=4 -${c_or_n} 0 -f $file & pid=$! - sleep .1 - grep '^State:[ ]*[S]' /proc/$pid/status > /dev/null || fail=1 + sleep .5 + set _ `sed -n '/^State:[ ]*\([^ ]\)/s//\1/p' /proc/$pid/status` + shift # Remove the leading `_'. + state=$1 + case $state in + S*) ;; + *) echo $0: process in unexpected state: $state 1>&2; fail=1 ;; + esac kill $pid done done |