diff mbox series

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

Message ID 160013431528.2923511.17636617456077025611.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series fstests: tons of random fixes | expand

Commit Message

Darrick J. Wong Sept. 15, 2020, 1:45 a.m. UTC
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(-)

Comments

Zorro Lang Sept. 16, 2020, 12:05 p.m. UTC | #1
On Mon, Sep 14, 2020 at 06:45:15PM -0700, Darrick J. Wong wrote:
> 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>
> ---

Good to me,
Reviewed-by: Zorro Lang <zlang@redhat.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
>
Christoph Hellwig Sept. 17, 2020, 8:01 a.m. UTC | #2
On Mon, Sep 14, 2020 at 06:45:15PM -0700, Darrick J. Wong wrote:
> 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>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

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