diff mbox series

[03/40] fuzzy: don't use killall

Message ID 20241127045403.3665299-4-david@fromorbit.com (mailing list archive)
State New
Headers show
Series fstests: concurrent test execution | expand

Commit Message

Dave Chinner Nov. 27, 2024, 4:51 a.m. UTC
From: Dave Chinner <dchinner@redhat.com>

Having test cleanup call 'killall xfs_io fsx xfs_scrub' results in a
system wide process kill, rather than just the processes the test is
running directly.

Make sure we only kill processes the fuzz test directly owns. We can
do this with 'pkill --parent $$ <process names>' to limit the search
for processes to kill to just the children of the current process.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 common/fuzzy | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/common/fuzzy b/common/fuzzy
index 9181520a3..3a7f04aae 100644
--- a/common/fuzzy
+++ b/common/fuzzy
@@ -1145,7 +1145,6 @@  __stress_scrub_fsstress_loop() {
 _require_xfs_stress_scrub() {
 	_require_xfs_io_command "scrub"
 	_require_test_program "xfsfind"
-	_require_command "$KILLALL_PROG" killall
 	_require_freeze
 	command -v _filter_scratch &>/dev/null || \
 		_notrun 'xfs scrub stress test requires common/filter'
@@ -1178,7 +1177,9 @@  _scratch_xfs_stress_scrub_cleanup() {
 	# distorts the golden output.
 	echo "Killing stressor processes at $(date)" >> $seqres.full
 	_kill_fsstress
-	$KILLALL_PROG -INT xfs_io fsx xfs_scrub >> $seqres.full 2>&1
+	pkill -INT --parent $$ xfs_io >> $seqres.full 2>&1
+	pkill -INT --parent $$ fsx >> $seqres.full 2>&1
+	pkill -INT --parent $$ xfs_scrub >> $seqres.full 2>&1
 
 	# Tests are not allowed to exit with the scratch fs frozen.  If we
 	# started a fs freeze/thaw background loop, wait for that loop to exit