From f9c6c730eb31299491022c1c3c3f97f873350bf1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Sun, 21 Sep 2025 20:14:10 +0100 Subject: [PATCH] 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. --- tests/du/move-dir-while-traversing.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; } -- 2.47.3