1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

TEST-55-OOMD: stop test units when unnecessary

Then, sleep becomes not necessary anymore. This greatly improve performance.

(cherry picked from commit 98a0bb8a64)
This commit is contained in:
Yu Watanabe 2024-10-16 15:18:41 +09:00 committed by Luca Boccassi
parent 0932445e1e
commit 0dfd4d6996

View File

@ -119,6 +119,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() {
@ -141,8 +146,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]
@ -166,6 +169,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