Whamcloud - gitweb
LU-17679 tests: make stdout unbuffered in sanity/851 04/55904/3
authorLei Feng <flei@whamcloud.com>
Thu, 1 Aug 2024 07:34:25 +0000 (15:34 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 8 Aug 2024 00:18:31 +0000 (00:18 +0000)
Make stdout unbuffered in sanity/test_851.
So that the output can be detected ASAP.

Fixes: 7101742b459 ("LU-17490 tests: verify fanotify works for lustre")
Signed-off-by: Lei Feng <flei@whamcloud.com>
Test-Parameters: trivial
Test-Parameters: testlist=sanity env=ONLY=851,ONLY_REPEAT=1000
Change-Id: I852a73b6bbdcbae7dfe1704183d4cb3c8200be43
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55904
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/tests/monitor_lustrefs.c
lustre/tests/sanity.sh

index b9fdf36..2ab0db8 100644 (file)
@@ -142,7 +142,7 @@ int main(int argc, char *argv[])
                len = read(fd, (void *)&buf[0], sizeof(buf));
                if (len < 0 && errno != EAGAIN) {
                        fprintf(stderr,
-                               "failed to read from fanotiify file descriptor."
+                               "failed to read from fanotify file descriptor."
                                " %d:%s",
                                errno, strerror(errno));
                        exit(EXIT_FAILURE);
index 8a2662b..913fb6e 100755 (executable)
@@ -33134,7 +33134,7 @@ test_851() {
 
        test_mkdir $dir || error "failed to create dir $dir"
 
-       $fanotify_prog $DIR > $report &
+       stdbuf -o0 $fanotify_prog $DIR > $report &
        pid=$!
 
        sleep 1
@@ -33146,8 +33146,8 @@ test_851() {
        stack_trap "rm -f $report"
 
        echo "1234567890" > $file
-       wait_update_cond localhost "stat -c %s $report" "-gt" "0" 30 ||
-               error "fanotify did not report anything after 30 seconds"
+       wait_update_cond localhost "stat -c %s $report" "-gt" "0" 60 ||
+               error "fanotify did not report anything after 60 seconds"
        grep -a -E "open.*:$file:" $report ||
                error "no open event for writing $file"
        grep -a -E "write.*:$file:" $report ||
@@ -33157,8 +33157,8 @@ test_851() {
 
        > $report
        cat $file
-       wait_update_cond localhost "stat -c %s $report" "-gt" "0" 30 ||
-               error "fanotify did not report anything after 30 seconds"
+       wait_update_cond localhost "stat -c %s $report" "-gt" "0" 60 ||
+               error "fanotify did not report anything after 60 seconds"
        grep -a -E "open.*:$file:" $report ||
                error "no open event for reading $file"
        grep -a -E "read.*:$file:" $report ||