On 2020-07-27 14:03, Pádraig Brady wrote: > On 27/07/2020 07:25, Bernhard Voelker wrote: >> 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? > > Well it doesn't even print the message: > "tail: 'dir/file' has become inaccessible: No such file or directory" > which should happen in any mode.
yes, it looks like after the initial "inotify" output, that the timeout command killed the tail process before that could see that 'dir' has disappeared. Unfortunately, we don't see the 'wait' status either. > I can't see where the issue is TBH. > All I can suggest is to change --max-unchanged-stats and --sleep-interval > in an attempt to make it more reproducible. Okay, I'll try [1] with above options ... and also: a) outputting the 'wait' status to stdout, and b) not swallowing 'grep' output. Diff attached. Let's see if there's a difference, or a little hint what happens. [1] https://build.opensuse.org/project/monitor/home:berny:branches:Base:System Thanks & have a nice day, Berny
diff --git a/tests/tail-2/inotify-dir-recreate.sh b/tests/tail-2/inotify-dir-recreate.sh index 469876b98..5d629d8cd 100755 --- a/tests/tail-2/inotify-dir-recreate.sh +++ b/tests/tail-2/inotify-dir-recreate.sh @@ -25,7 +25,12 @@ grep '^#define HAVE_INOTIFY 1' "$CONFIG_HEADER" >/dev/null && is_local_dir_ . \ || skip_ 'inotify is not supported' # Terminate any background tail process -cleanup_() { kill $pid 2>/dev/null && wait $pid; } +cleanup_() { + kill $pid 2>/dev/null \ + || return + wait $pid + echo "wait status (PID=$pid): $?" +} cleanup_fail_ () { @@ -39,7 +44,7 @@ cleanup_fail_ () check_tail_output_ () { local delay="$1" - grep $check_re $check_f > /dev/null || + grep $check_re $check_f || { sleep $delay ; return 1; } } @@ -54,7 +59,8 @@ grep_timeout_ () mkdir dir && echo 'inotify' > dir/file || framework_failure_ #tail must print content of the file to stdout, verify -timeout 60 tail --pid=$$ -F dir/file >out 2>&1 & pid=$! +timeout 60 \ + tail --pid=$$ -F -s1 --max-unchanged-stats=2 dir/file >out 2>&1 & pid=$! grep_timeout_ 'inotify' 'out' || { cleanup_fail_ 'file to be tailed does not exist'; }