[PATCH 22/24] xfs/141: run for longer with TIME_FACTOR

Darrick J. Wong
2020-09-15T01:45:28Z

From: Darrick J. Wong <darrick.wong@oracle.com>

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>
---
tests/xfs/141 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/xfs/141 b/tests/xfs/141
index 754ca37a..ef7210ff 100755
--- a/tests/xfs/141
+++ b/tests/xfs/141
@@ -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