1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00

TEST-55-OOMD: stop test units when unnecessary

Then, sleep becomes not necessary anymore. This greatly improve performance.
This commit is contained in:
Yu Watanabe 2024-10-16 15:18:41 +09:00
parent 665882f8f3
commit 98a0bb8a64

View File

@ -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 <<EOF
[Service]
@ -170,6 +173,13 @@ EOF
if ! systemctl status TEST-55-OOMD-testbloat.service; then exit 25; fi
if systemctl status TEST-55-OOMD-testmunch.service; then exit 43; fi
if ! systemctl status TEST-55-OOMD-testchill.service; then exit 24; fi
systemctl kill --signal=KILL TEST-55-OOMD-testbloat.service || :
systemctl kill --signal=KILL TEST-55-OOMD-testmunch.service || :
systemctl stop TEST-55-OOMD-testbloat.service
systemctl stop TEST-55-OOMD-testmunch.service
systemctl stop TEST-55-OOMD-testchill.service
systemctl stop TEST-55-OOMD-workload.slice
}
run_testcases