]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commit
btrfs: add helper to kill background process running _btrfs_stress_balance
authorFilipe Manana <fdmanana@suse.com>
Wed, 27 Mar 2024 17:11:35 +0000 (17:11 +0000)
committerAnand Jain <anand.jain@oracle.com>
Wed, 3 Apr 2024 07:06:31 +0000 (15:06 +0800)
commitaa4799f3d2efa779f8d4e7a5f5deae4218b2780b
treed8b194ddeafeb1826dffac7b2cb97cc3f0ba3aa6
parente72e052d56c3f05e533f4b67056f86931f688368
btrfs: add helper to kill background process running _btrfs_stress_balance

Killing a background process running _btrfs_stress_balance() is not as
simple as sending a signal to the process and waiting for it to die.
Therefore we have the following logic to terminate such process:

   kill $pid
   wait $pid
   # Wait for the balance operation to finish.
   while ps aux | grep "balance start" | grep -qv grep; do
       sleep 1
   done

Since this is repeated in several test cases, move this logic to a common
helper and use it in all affected test cases. This will help to avoid
repeating the same code again several times in upcoming changes.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
common/btrfs
tests/btrfs/060
tests/btrfs/061
tests/btrfs/062
tests/btrfs/063
tests/btrfs/064
tests/btrfs/255