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

TEST-55-OOMD: check slice property before stressing slice

This commit is contained in:
Yu Watanabe 2024-10-16 15:20:08 +09:00
parent 98a0bb8a64
commit a6092b532e

View File

@ -100,14 +100,15 @@ test_basic() {
shift
systemctl "$@" start TEST-55-OOMD-testchill.service
systemctl "$@" start TEST-55-OOMD-testbloat.service
systemctl "$@" status TEST-55-OOMD-testchill.service
systemctl "$@" status TEST-55-OOMD-workload.slice
# Verify systemd-oomd is monitoring the expected units.
timeout 1m bash -xec "until oomctl | grep -q -F 'Path: $cgroup_path'; do sleep 1; done"
assert_in 'Memory Pressure Limit: 20.00%' \
"$(oomctl | tac | sed -e '/Memory Pressure Monitored CGroups:/q' | tac | grep -A7 "Path: $cgroup_path")"
systemctl "$@" status TEST-55-OOMD-testchill.service
systemctl "$@" start TEST-55-OOMD-testbloat.service
# systemd-oomd watches for elevated pressure for 2 seconds before acting.
# It can take time to build up pressure so either wait 2 minutes or for the service to fail.