All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Zorro Lang <zlang@redhat.com>
Cc: "Darrick J . Wong" <darrick.wong@oracle.com>,
	Dave Chinner <david@fromorbit.com>,
	fstests@vger.kernel.org
Subject: [PATCH 4/4] xfs/{422,517}: fix false positive failure
Date: Sun, 19 Jun 2022 16:46:57 +0300	[thread overview]
Message-ID: <20220619134657.1846292-5-amir73il@gmail.com> (raw)
In-Reply-To: <20220619134657.1846292-1-amir73il@gmail.com>

xfs/517 fails randomally with this error:
 QA output created by 517
 Format and populate
 Concurrent fsmap and freeze
+Terminated
 Test done

These two test run fsstress inside the sub-shell stress_loop(),
which is run as a background job.

The sub-shell has an inner loop that exist after at least 30s.
The outer shell, sleeps for 32s and then kills fsstress using killall.
If the inner sub-shell loop does not exit before fsstress is killed,
bash sub-shell prints "Terminated" to stderr and breaks golden output.

There are two easy solutions to this issue:
1. The sub-shell stderr could be redirected to /dev/null or $seq.full
2. killall can use SIGINT which suppresses the "Terminated" print

The tests generic/270, generic/388, generic/475, generic/648 use
the first method, but that looses any other errors that fsstress may
report during the inner loop.

overlay/058 uses the second method (but with SIGPIPE). Use this method
to preserve other reported errors.

Alas, this is not enough to fix the false positive failure - the main
test thread needs to also wait for the background jobs to exit.
Otherwise, killall -9 in _cleanup() will cause a similar "Killed"
message in stderr.

Adding -w to killall requires to move it to after unfreeze, otherwise,
fsstress process may be left blocked on a frozen fs and wait will not
return.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
 tests/xfs/422 | 5 ++++-
 tests/xfs/517 | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/xfs/422 b/tests/xfs/422
index 8e9a3576..63d133f8 100755
--- a/tests/xfs/422
+++ b/tests/xfs/422
@@ -95,8 +95,11 @@ while [ "$(date +%s)" -lt $((end + 2)) ]; do
 done
 
 # ...and clean up after the loops in case they didn't do it themselves.
-$KILLALL_PROG -TERM xfs_io fsstress >> $seqres.full 2>&1
+# First thaw fs, so fsstress can exit, then kill and wait for fsstress.
+# Use of SIGINT instead of SIGTERM suppresses the "Terminated" print
+# from the XXX_loop() bash sub-shells
 $XFS_IO_PROG -x -c 'thaw' $SCRATCH_MNT >> $seqres.full 2>&1
+$KILLALL_PROG -w -SIGINT $XFS_IO_PROG $FSSTRESS_PROG >> $seqres.full 2>&1
 
 echo "Loop finished at $(date)" >> $seqres.full
 echo "Test done"
diff --git a/tests/xfs/517 b/tests/xfs/517
index 18404248..2f52d634 100755
--- a/tests/xfs/517
+++ b/tests/xfs/517
@@ -92,8 +92,11 @@ while [ "$(date +%s)" -lt $((end + 2)) ]; do
 done
 
 # ...and clean up after the loops in case they didn't do it themselves.
-$KILLALL_PROG -TERM xfs_io fsstress >> $seqres.full 2>&1
+# First thaw fs, so fsstress can exit, then kill and wait for fsstress.
+# Use of SIGINT instead of SIGTERM suppresses the "Terminated" print
+# from the XXX_loop() bash sub-shells
 $XFS_IO_PROG -x -c 'thaw' $SCRATCH_MNT >> $seqres.full 2>&1
+$KILLALL_PROG -w -SIGINT $XFS_IO_PROG $FSSTRESS_PROG >> $seqres.full 2>&1
 
 echo "Loop finished at $(date)" >> $seqres.full
 echo "Test done"
-- 
2.25.1


      parent reply	other threads:[~2022-06-19 13:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-19 13:46 [PATCH 0/4] aborted fstests may leave frozen fs behind Amir Goldstein
2022-06-19 13:46 ` [PATCH 1/4] fstests: add missing _require_freeze() to tests Amir Goldstein
2022-06-23 18:00   ` Darrick J. Wong
2022-06-24  4:05     ` Amir Goldstein
2022-06-24  6:27       ` Zorro Lang
2022-06-19 13:46 ` [PATCH 2/4] fstests: make sure to unfreeze test and scratch mounts Amir Goldstein
2022-06-20 11:17   ` Zorro Lang
2022-06-20 12:13     ` Amir Goldstein
2022-06-20 14:21       ` Zorro Lang
2022-06-20 15:08         ` Amir Goldstein
2022-06-20 22:34         ` Dave Chinner
2022-06-21  2:53           ` Amir Goldstein
2022-06-20 22:06   ` Dave Chinner
2022-06-21  2:57     ` Amir Goldstein
2022-06-19 13:46 ` [PATCH 3/4] xfs/{422,517}: add missing killall to _cleanup() Amir Goldstein
2022-06-21  4:02   ` Amir Goldstein
2022-06-23 18:04     ` Darrick J. Wong
2022-06-24  4:36       ` Amir Goldstein
2022-06-24  6:31         ` Zorro Lang
2022-06-24  6:41           ` Amir Goldstein
2022-06-24 15:09             ` Zorro Lang
2022-06-24  4:49       ` Delegating fstests maintenance work (Was: Re: [PATCH 3/4] xfs/{422,517}: add missing killall to _cleanup()) Amir Goldstein
2022-06-25  3:11         ` Darrick J. Wong
2022-06-19 13:46 ` Amir Goldstein [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220619134657.1846292-5-amir73il@gmail.com \
    --to=amir73il@gmail.com \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=fstests@vger.kernel.org \
    --cc=zlang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.