From 98a0bb8a6487a1bd0767223f3738525c2b3eae52 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 16 Oct 2024 15:18:41 +0900 Subject: [PATCH] TEST-55-OOMD: stop test units when unnecessary Then, sleep becomes not necessary anymore. This greatly improve performance. --- test/units/TEST-55-OOMD.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/units/TEST-55-OOMD.sh b/test/units/TEST-55-OOMD.sh index ac49643074..84f4283fbf 100755 --- a/test/units/TEST-55-OOMD.sh +++ b/test/units/TEST-55-OOMD.sh @@ -122,6 +122,11 @@ test_basic() { # testbloat should be killed and testchill should be fine if systemctl "$@" status TEST-55-OOMD-testbloat.service; then exit 42; fi if ! systemctl "$@" status TEST-55-OOMD-testchill.service; then exit 24; fi + + systemctl "$@" kill --signal=KILL TEST-55-OOMD-testbloat.service || : + systemctl "$@" stop TEST-55-OOMD-testbloat.service + systemctl "$@" stop TEST-55-OOMD-testchill.service + systemctl "$@" stop TEST-55-OOMD-workload.slice } testcase_basic_system() { @@ -145,8 +150,6 @@ testcase_preference_avoid() { return 0 fi - sleep 120 # wait for systemd-oomd kill cool down and elevated memory pressure to come down - mkdir -p /run/systemd/system/TEST-55-OOMD-testbloat.service.d/ cat >/run/systemd/system/TEST-55-OOMD-testbloat.service.d/99-managed-oom-preference.conf <