From 66840271037f55738f688fa2c650fe383fbed592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Sat, 23 Sep 2017 19:37:13 -0700 Subject: [PATCH] tests: fix test hang on macOS 10.13 * tests/split/filter.sh: Due to an invalid 'FILE = zero.in' construct trying to initialize a FILE variable, it would instead try to run the FILE command which is present on macOS 10.13, and was seen to hang with APFS file systems at least. We also remove a redundant duplicate test clause introduced during a rebase, and simplify the piped timeout command, to avoid requiring a subshell and associated quoting. * THANKS.in: Add the reporter Jack Howarth. Fixes https://bugs.gnu.org/28506 --- THANKS.in | 1 + tests/split/filter.sh | 18 +++++++----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/THANKS.in b/THANKS.in index 70c0021..b5e11f0 100644 --- a/THANKS.in +++ b/THANKS.in @@ -264,6 +264,7 @@ Ilya N. Golubev address@hidden Ingo Saitz address@hidden Ivan Labath address@hidden Ivo Timmermans address@hidden +Jack Howarth address@hidden Jacky Fong address@hidden James Antill address@hidden James Hunt address@hidden diff --git a/tests/split/filter.sh b/tests/split/filter.sh index 96602bd..25b90e5 100755 --- a/tests/split/filter.sh +++ b/tests/split/filter.sh @@ -19,7 +19,7 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ split require_sparse_support_ # for 'truncate --size=$LARGE' -xz --version || skip_ "xz (better than gzip/bzip2) required" +xz --version || skip_ 'xz required' for total_n_lines in 5 3000 20000; do seq $total_n_lines > in || framework_failure_ @@ -53,15 +53,17 @@ yes | head -n200K | split -b1G --filter='head -c1 >/dev/null' || fail=1 # Ensure that "endless" input is ignored when all filters finish for mode in '' 'r/'; do - FILE = '-' + in_file='-' + in_cmd='yes' if test "$mode" = ''; then - FILE = 'zero.in' + in_file='zero.in' + in_cmd='true' truncate -s10T "$FILE" || continue fi for N in 1 2; do rm -f x??.n || framework_failure_ - timeout 10 sh -c \ - "yes | split --filter='head -c1 >\$FILE.n' -n $mode$N $FILE" || fail=1 + $in_cmd | + timeout 10 split --filter='head -c1 >$FILE.n' -n $mode$N $in_file || fail=1 # Also ensure we get appropriate output from each filter seq 1 $N | tr '0-9' 1 > stat.exp stat -c%s x??.n > stat.out || framework_failure_ @@ -75,10 +77,4 @@ for buf in 1000 1000000; do "yes | split --filter='head -c1 >/dev/null' -b $buf" || fail=1 done -# Ensure that "endless" input _is_ processed for unbounded number of filters -for buf in 1000 1000000; do - returns_ 124 timeout .5 sh -c \ - "yes | split --filter='head -c1 >/dev/null' -b $buf" || fail=1 -done - Exit $fail -- 2.9.3