From 63d2f05f5283c88f6c60ebe6de7a26ce6b9e4ee8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Sat, 23 Sep 2017 19:37:13 -0700 Subject: [PATCH] tests: fix test hang on case insenitive file systems * 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 with APFS. 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 70c00213b8..b5e11f0a46 100644 --- a/THANKS.in +++ b/THANKS.in @@ -264,6 +264,7 @@ Ilya N. Golubev gin@mo.msk.ru Ingo Saitz ingo@debian.org Ivan Labath labath3@st.fmph.uniba.sk Ivo Timmermans ivo@debian.org +Jack Howarth howarth.mailing.lists@gmail.com Jacky Fong jacky.fong@utoronto.ca James Antill jmanti%essex.ac.uk@seralph21.essex.ac.uk James Hunt jamesodhunt@hotmail.com diff --git a/tests/split/filter.sh b/tests/split/filter.sh index 96602bdb27..25b90e5433 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.47.2