On openSUSE's build system, I sometimes see a test failure from the
above test on x86_64.  Trying again usually makes the test pass.

I'm not sure if we have a race in the test, but the result looks identical as if
tail(1) would have been started with the (test-only) option ---disable-inotify
(thus not being able to "revert to polling" as it started in this mode).

Any idea?

Have a nice day,
Berny
FAIL: tests/tail-2/inotify-dir-recreate
=======================================

++ initial_cwd_=/home/abuild/rpmbuild/BUILD/coreutils-8.32
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /home/abuild/rpmbuild/BUILD/coreutils-8.32 gt-inotify-dir-recreate.sh.XXXX
+++ case $# in
+++ destdir_=/home/abuild/rpmbuild/BUILD/coreutils-8.32
+++ template_=gt-inotify-dir-recreate.sh.XXXX
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ destdir_slash_=/home/abuild/rpmbuild/BUILD/coreutils-8.32/
+++ case $template_ in
++++ unset TMPDIR
+++ d=/home/abuild/rpmbuild/BUILD/coreutils-8.32/gt-inotify-dir-recreate.sh.6hwF
+++ case $d in
+++ :
+++ test -d /home/abuild/rpmbuild/BUILD/coreutils-8.32/gt-inotify-dir-recreate.sh.6hwF
++++ ls -dgo /home/abuild/rpmbuild/BUILD/coreutils-8.32/gt-inotify-dir-recreate.sh.6hwF
+++ perms='drwx------ 2 4096 Jul 26 17:45 /home/abuild/rpmbuild/BUILD/coreutils-8.32/gt-inotify-dir-recreate.sh.6hwF'
+++ case $perms in
+++ :
+++ echo /home/abuild/rpmbuild/BUILD/coreutils-8.32/gt-inotify-dir-recreate.sh.6hwF
+++ return
++ test_dir_=/home/abuild/rpmbuild/BUILD/coreutils-8.32/gt-inotify-dir-recreate.sh.6hwF
++ cd /home/abuild/rpmbuild/BUILD/coreutils-8.32/gt-inotify-dir-recreate.sh.6hwF
++ case $srcdir in
++ srcdir=../.
++ builddir=..
++ export srcdir builddir
++ gl_init_sh_nl_='
'
++ IFS=' 	
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ case $path_dir_ in
+ abs_path_dir_=/home/abuild/rpmbuild/BUILD/coreutils-8.32/./src
+ case $abs_path_dir_ in
+ PATH=/home/abuild/rpmbuild/BUILD/coreutils-8.32/./src:/home/abuild/rpmbuild/BUILD/coreutils-8.32/src:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin
+ create_exe_shims_ /home/abuild/rpmbuild/BUILD/coreutils-8.32/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ tail
+ require_built_ tail
+ skip_=no
+ for i in "$@"
+ case " $built_programs " in
+ test no = yes
+ test yes = yes
+ local i
+ for i in $*
+ env tail --version
tail (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, Ian Lance Taylor,
and Jim Meyering.
+ grep '^#define HAVE_INOTIFY 1' /home/abuild/rpmbuild/BUILD/coreutils-8.32/lib/config.h
+ is_local_dir_ .
+ test 1 = 1
+ df --local .
+ mkdir dir
+ echo inotify
+ pid=32747
+ timeout 60 tail --pid=32709 -F dir/file
+ grep_timeout_ inotify out
+ check_re=inotify
+ check_f=out
+ retry_delay_ check_tail_output_ .1 5
+ local test_func=check_tail_output_
+ local init_delay=.1
+ local max_n_tries=5
+ shift 3
+ local attempt=1
+ local num_sleeps=1
+ local time_fail
+ test 1 -le 5
++ gawk -v n=1 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.1
+ check_tail_output_ 0.1
+ local delay=0.1
+ grep inotify out
+ time_fail=0
+ break
+ test 0 = 0
+ inotify_failed_re='inotify (resources exhausted|cannot be used)'
+ grep -E 'inotify (resources exhausted|cannot be used)' out
+ rm -r dir
+ grep_timeout_ polling out
+ check_re=polling
+ check_f=out
+ retry_delay_ check_tail_output_ .1 5
+ local test_func=check_tail_output_
+ local init_delay=.1
+ local max_n_tries=5
+ shift 3
+ local attempt=1
+ local num_sleeps=1
+ local time_fail
+ test 1 -le 5
++ gawk -v n=1 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.1
+ check_tail_output_ 0.1
+ local delay=0.1
+ grep polling out
+ sleep 0.1
+ return 1
+ time_fail=1
++ expr 1 + 1
+ attempt=2
++ expr 1 '*' 2
+ num_sleeps=2
+ test 2 -le 5
++ gawk -v n=2 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.2
+ check_tail_output_ 0.2
+ local delay=0.2
+ grep polling out
+ sleep 0.2
+ return 1
+ time_fail=1
++ expr 2 + 1
+ attempt=3
++ expr 2 '*' 2
+ num_sleeps=4
+ test 3 -le 5
++ gawk -v n=4 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.4
+ check_tail_output_ 0.4
+ local delay=0.4
+ grep polling out
+ sleep 0.4
+ return 1
+ time_fail=1
++ expr 3 + 1
+ attempt=4
++ expr 4 '*' 2
+ num_sleeps=8
+ test 4 -le 5
++ gawk -v n=8 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.8
+ check_tail_output_ 0.8
+ local delay=0.8
+ grep polling out
+ sleep 0.8
+ return 1
+ time_fail=1
++ expr 4 + 1
+ attempt=5
++ expr 8 '*' 2
+ num_sleeps=16
+ test 5 -le 5
++ gawk -v n=16 -v s=.1 'BEGIN { print s * n }'
+ local delay=1.6
+ check_tail_output_ 1.6
+ local delay=1.6
+ grep polling out
+ sleep 1.6
+ return 1
+ time_fail=1
++ expr 5 + 1
+ attempt=6
++ expr 16 '*' 2
+ num_sleeps=32
+ test 6 -le 5
+ test 1 = 0
+ cleanup_fail_ 'tail did not switch to polling mode'
+ warn_ tail did not switch to polling mode
+ case $IFS in
+ printf '%s\n' 'tail did not switch to polling mode'
tail did not switch to polling mode
+ test 9 = 2
+ printf '%s\n' 'tail did not switch to polling mode'
+ sed 1q
+ cleanup_
+ kill 32747
+ wait 32747
+ fail=1
+ mkdir dir
+ touch dir/file
+ grep_timeout_ appeared out
+ check_re=appeared
+ check_f=out
+ retry_delay_ check_tail_output_ .1 5
+ local test_func=check_tail_output_
+ local init_delay=.1
+ local max_n_tries=5
+ shift 3
+ local attempt=1
+ local num_sleeps=1
+ local time_fail
+ test 1 -le 5
++ gawk -v n=1 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.1
+ check_tail_output_ 0.1
+ local delay=0.1
+ grep appeared out
+ sleep 0.1
+ return 1
+ time_fail=1
++ expr 1 + 1
+ attempt=2
++ expr 1 '*' 2
+ num_sleeps=2
+ test 2 -le 5
++ gawk -v n=2 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.2
+ check_tail_output_ 0.2
+ local delay=0.2
+ grep appeared out
+ sleep 0.2
+ return 1
+ time_fail=1
++ expr 2 + 1
+ attempt=3
++ expr 2 '*' 2
+ num_sleeps=4
+ test 3 -le 5
++ gawk -v n=4 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.4
+ check_tail_output_ 0.4
+ local delay=0.4
+ grep appeared out
+ sleep 0.4
+ return 1
+ time_fail=1
++ expr 3 + 1
+ attempt=4
++ expr 4 '*' 2
+ num_sleeps=8
+ test 4 -le 5
++ gawk -v n=8 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.8
+ check_tail_output_ 0.8
+ local delay=0.8
+ grep appeared out
+ sleep 0.8
+ return 1
+ time_fail=1
++ expr 4 + 1
+ attempt=5
++ expr 8 '*' 2
+ num_sleeps=16
+ test 5 -le 5
++ gawk -v n=16 -v s=.1 'BEGIN { print s * n }'
+ local delay=1.6
+ check_tail_output_ 1.6
+ local delay=1.6
+ grep appeared out
+ sleep 1.6
+ return 1
+ time_fail=1
++ expr 5 + 1
+ attempt=6
++ expr 16 '*' 2
+ num_sleeps=32
+ test 6 -le 5
+ test 1 = 0
+ cleanup_fail_ 'previously removed file did not appear'
+ warn_ previously removed file did not appear
+ case $IFS in
+ printf '%s\n' 'previously removed file did not appear'
previously removed file did not appear
+ test 9 = 2
+ printf '%s\n' 'previously removed file did not appear'
+ sed 1q
+ cleanup_
+ kill 32747
+ fail=1
+ cleanup_
+ kill 32747
+ cat
+ compare exp out
+ compare_dev_null_ exp out
+ test 2 = 2
+ test xexp = x/dev/null
+ test xout = x/dev/null
+ return 2
+ case $? in
+ compare_ exp out
+ diff -u exp out
--- exp	2020-07-26 17:45:49.882144782 +0000
+++ out	2020-07-26 17:45:43.538145050 +0000
@@ -1,5 +1 @@
 inotify
-tail: 'dir/file' has become inaccessible: No such file or directory
-tail: directory containing watched file was removed
-tail: inotify cannot be used, reverting to polling
-tail: 'dir/file' has appeared;  following new file
+ fail=1
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=1
+ cleanup_
+ kill 32747
+ test '' = yes
+ cd /home/abuild/rpmbuild/BUILD/coreutils-8.32
+ chmod -R u+rwx /home/abuild/rpmbuild/BUILD/coreutils-8.32/gt-inotify-dir-recreate.sh.6hwF
+ rm -rf /home/abuild/rpmbuild/BUILD/coreutils-8.32/gt-inotify-dir-recreate.sh.6hwF
+ exit 1
FAIL tests/tail-2/inotify-dir-recreate.sh (exit status: 1)

Reply via email to