diff mbox series

[2/8] generic/561: hide assertions when duperemove is killed

Message ID 162561727795.543423.1496821526582808789.stgit@locust (mailing list archive)
State New, archived
Headers show
Series fstests: random fixes | expand

Commit Message

Darrick J. Wong July 7, 2021, 12:21 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Use some bash redirection trickery to capture in $seqres.full all of
bash's warnings about duperemove being killed due to assertions
triggering.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/561 |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Allison Henderson July 9, 2021, 11:38 p.m. UTC | #1
On 7/6/21 5:21 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Use some bash redirection trickery to capture in $seqres.full all of
> bash's warnings about duperemove being killed due to assertions
> triggering.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>   tests/generic/561 |    9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> 
> diff --git a/tests/generic/561 b/tests/generic/561
> index bfd4443d..85037e50 100755
> --- a/tests/generic/561
> +++ b/tests/generic/561
> @@ -62,8 +62,13 @@ dupe_run=$TEST_DIR/${seq}-running
>   touch $dupe_run
>   for ((i = 0; i < $((2 * LOAD_FACTOR)); i++)); do
>   	while [ -e $dupe_run ]; do
> -		$DUPEREMOVE_PROG -dr --dedupe-options=same $testdir \
> -			>>$seqres.full 2>&1
> +		# Employ shell trickery here so that the golden output does not
nit:
I think I'd be more more specific with the commentary:

                 # We run cmd in a bash shell so that the golden output ...
> +		# capture assertions that trigger when killall shoots down
> +		# dupremove processes in an arbitrary order, which leaves the
> +		# memory in an inconsistent state long enough for the assert
> +		# to trip.
> +		cmd="$DUPEREMOVE_PROG -dr --dedupe-options=same $testdir"
> +		bash -c "$cmd" >> $seqres.full 2>&1
>   	done 2>&1 | sed -e '/Terminated/d' &
>   	dedup_pids="$! $dedup_pids"
>   done
> 
Otherwise looks fine to me
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Darrick J. Wong July 10, 2021, 1:25 a.m. UTC | #2
On Fri, Jul 09, 2021 at 04:38:46PM -0700, Allison Henderson wrote:
> 
> 
> On 7/6/21 5:21 PM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Use some bash redirection trickery to capture in $seqres.full all of
> > bash's warnings about duperemove being killed due to assertions
> > triggering.
> > 
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> >   tests/generic/561 |    9 +++++++--
> >   1 file changed, 7 insertions(+), 2 deletions(-)
> > 
> > 
> > diff --git a/tests/generic/561 b/tests/generic/561
> > index bfd4443d..85037e50 100755
> > --- a/tests/generic/561
> > +++ b/tests/generic/561
> > @@ -62,8 +62,13 @@ dupe_run=$TEST_DIR/${seq}-running
> >   touch $dupe_run
> >   for ((i = 0; i < $((2 * LOAD_FACTOR)); i++)); do
> >   	while [ -e $dupe_run ]; do
> > -		$DUPEREMOVE_PROG -dr --dedupe-options=same $testdir \
> > -			>>$seqres.full 2>&1
> > +		# Employ shell trickery here so that the golden output does not
> nit:
> I think I'd be more more specific with the commentary:
> 
>                 # We run cmd in a bash shell so that the golden output ...

Ok, fixed.

--D

> > +		# capture assertions that trigger when killall shoots down
> > +		# dupremove processes in an arbitrary order, which leaves the
> > +		# memory in an inconsistent state long enough for the assert
> > +		# to trip.
> > +		cmd="$DUPEREMOVE_PROG -dr --dedupe-options=same $testdir"
> > +		bash -c "$cmd" >> $seqres.full 2>&1
> >   	done 2>&1 | sed -e '/Terminated/d' &
> >   	dedup_pids="$! $dedup_pids"
> >   done
> > 
> Otherwise looks fine to me
> Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
diff mbox series

Patch

diff --git a/tests/generic/561 b/tests/generic/561
index bfd4443d..85037e50 100755
--- a/tests/generic/561
+++ b/tests/generic/561
@@ -62,8 +62,13 @@  dupe_run=$TEST_DIR/${seq}-running
 touch $dupe_run
 for ((i = 0; i < $((2 * LOAD_FACTOR)); i++)); do
 	while [ -e $dupe_run ]; do
-		$DUPEREMOVE_PROG -dr --dedupe-options=same $testdir \
-			>>$seqres.full 2>&1
+		# Employ shell trickery here so that the golden output does not
+		# capture assertions that trigger when killall shoots down
+		# dupremove processes in an arbitrary order, which leaves the
+		# memory in an inconsistent state long enough for the assert
+		# to trip.
+		cmd="$DUPEREMOVE_PROG -dr --dedupe-options=same $testdir"
+		bash -c "$cmd" >> $seqres.full 2>&1
 	done 2>&1 | sed -e '/Terminated/d' &
 	dedup_pids="$! $dedup_pids"
 done