Whamcloud - gitweb
LU-16953 tests: wait longer in replay-dual/test_31 21/51621/1
authorLei Feng <flei@whamcloud.com>
Tue, 11 Jul 2023 00:13:35 +0000 (08:13 +0800)
committerLei Feng <flei@whamcloud.com>
Tue, 11 Jul 2023 00:13:35 +0000 (08:13 +0800)
Wait until file was created in replay-dual/test_31.

Signed-off-by: Lei Feng <flei@whamcloud.com>
Test-Parameters: trivial testlist=replay-dual env=ONLY=31,ONLY_REPEAT=100
Change-Id: I847beb51d53e667f1599c9693aa5eb099dcf9435

lustre/tests/replay-dual.sh

index 3202973..5273fc0 100755 (executable)
@@ -904,7 +904,7 @@ test_24 () {
 }
 run_test 24 "reconstruct on non-existing object"
 
-# end commit on sharing tests 
+# end commit on sharing tests
 
 test_25() {
        cancel_lru_locks osc
@@ -1184,7 +1184,9 @@ test_31() {
        $LCTL set_param fail_loc=0x80001420
        $MULTIOP $DIR1/$tdir/mdtdir/$tfile Osw4096c &
        multiops+=($!)
-       sleep 0.5
+       while [ ! -f $DIR1/$tdir/mdtdir/$tfile ]; do
+               sleep 0.5
+       done
        $MULTIOP $DIR2/$tdir/mdtdir/$tfile oO_WRONLY:w4096c &
        multiops+=($!)
        sleep 0.5
@@ -1198,8 +1200,14 @@ test_31() {
        wait $failpid
        local failed=0
 
+       echo "pids: ${multiops[@]}"
        for pid in "${multiops[@]}"; do
-               wait $pid || ((failed++))
+               wait $pid
+               local rc=$?
+               if (( $rc != 0 )); then
+                       echo "wait $pid failed, rc = $rc"
+                       ((failed++))
+               fi
        done
        ((failed == 0)) || error "$failed multiops failed"
 }