From 0edba4f01baf13178e59ee086353533d1d443930 Mon Sep 17 00:00:00 2001 From: Kamil Gierszewski Date: Wed, 30 Oct 2024 00:55:34 +0100 Subject: [PATCH] test-framework: Make kill_all_io faster Signed-off-by: Kamil Gierszewski --- test_utils/os_utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test_utils/os_utils.py b/test_utils/os_utils.py index c0bb0e2..e9c01f1 100644 --- a/test_utils/os_utils.py +++ b/test_utils/os_utils.py @@ -381,10 +381,13 @@ def get_udev_service_path(unit_name): return path -def kill_all_io(): - # TERM signal should be used in preference to the KILL signal, since a - # process may install a handler for the TERM signal in order to perform - # clean-up steps before terminating in an orderly fashion. +def kill_all_io(graceful=True): + if graceful: + # TERM signal should be used in preference to the KILL signal, since a + # process may install a handler for the TERM signal in order to perform + # clean-up steps before terminating in an orderly fashion. + TestRun.executor.run("killall -q --signal TERM dd fio blktrace") + time.sleep(3) TestRun.executor.run("killall -q --signal TERM dd fio blktrace") time.sleep(3) TestRun.executor.run("killall -q --signal KILL dd fio blktrace")