From: Pádraig Brady Date: Sun, 21 Sep 2025 19:14:10 +0000 (+0100) Subject: tests: du: avoid false failure in racy test X-Git-Tag: v9.8~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9c6c730eb31299491022c1c3c3f97f873350bf1;p=thirdparty%2Fcoreutils.git tests: du: avoid false failure in racy test * tests/du/move-dir-while-traversing.sh: Expand the work to avoid a false failure where du completes before the directory is moved. Also expand the timeout to our more standard 10s to avoid the "directory mover" being killed before du processes the directory. This doesn't perceptibly impact the run time of the test. Reported by Bruno Haible on a CentOS 7 system. --- diff --git a/tests/du/move-dir-while-traversing.sh b/tests/du/move-dir-while-traversing.sh index 1d0a359bfc..adf482b8e6 100755 --- a/tests/du/move-dir-while-traversing.sh +++ b/tests/du/move-dir-while-traversing.sh @@ -66,9 +66,8 @@ long=d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z # du sometimes completes its traversal before the above rename. # Five iterations was not enough in 2 of 7 "make -j20 check" runs on a # 6/12-core system. However, using "10", I saw no failure in 20 trials. -# Using 10 iterations was not enough, either. -# Using 50, I saw no failure in 200 trials. -for i in $(seq 50); do +# 2011 this was set at 50, 2025 this was set at 99 +for i in $(seq 99); do mkdir -p $t/3/a/b/c/$i/$long || framework_failure_ done @@ -78,7 +77,7 @@ cleanup_() { kill $pid 2>/dev/null && wait $pid; } # Prohibit suspension, which could otherwise cause a timeout-induced FP failure. trap '' TSTP -timeout 6 ./inotify-watch-for-dir-access.py $t/3/a/b > start-msg & pid=$! +timeout 10 ./inotify-watch-for-dir-access.py $t/3/a/b > start-msg & pid=$! # Wait for the watcher to start... nonempty() { sleep $1; test -s start-msg; }