xfs/141: run for longer with TIME_FACTOR
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 15 Sep 2020 01:45:15 +0000 (18:45 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 20 Sep 2020 17:10:27 +0000 (01:10 +0800)
Allow the test runner to run the crash loop in this test for longer by
setting TIME_FACTOR.  This has been useful for finding bugs in log
recovery.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/141

index 754ca37..ef7210f 100755 (executable)
@@ -50,7 +50,8 @@ _scratch_mount
 
 sdev=$(_short_dev $SCRATCH_DEV)
 
-for i in $(seq 1 5); do
+nr_times=$((TIME_FACTOR * 5))
+while [ $nr_times -gt 0 ]; do
        # Enable error injection. Use a random bad crc factor up to 100
        # (increase this value to run fsstress longer).
        factor=$((RANDOM % 100 + 1))
@@ -65,6 +66,7 @@ for i in $(seq 1 5); do
        # write.
        _scratch_unmount
        _scratch_mount
+       nr_times=$((nr_times - 1))
 done
 
 # success, all done