1
0
mirror of https://github.com/systemd/systemd synced 2026-03-22 14:54:52 +01:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Yu Watanabe
bedc15706e
Merge pull request #20120 from yuwata/test-oomd-debug
test: enable debug logging of oomd
2021-07-13 23:30:16 +09:00
Yu Watanabe
7d5f4f1d4f test: also show the memory pressure of testchill.service
The memory pressure should be small, but let's log the value in
the journal of the test environment.
2021-07-03 05:05:36 +09:00
Yu Watanabe
fa7ff467b6 test: check memory pressure more frequently 2021-07-03 05:05:33 +09:00
Yu Watanabe
b7674ab206 test: enable debug logging of systemd-oomd 2021-07-03 05:04:59 +09:00

View File

@ -21,7 +21,17 @@ fi
rm -rf /etc/systemd/system/testsuite-55-testbloat.service.d
echo "DefaultMemoryPressureDurationSec=5s" >>/etc/systemd/oomd.conf
echo "DefaultMemoryPressureDurationSec=2s" >>/etc/systemd/oomd.conf
mkdir -p /etc/systemd/system/systemd-oomd.service.d/
echo -e "[Service]\nEnvironment=SYSTEMD_LOG_LEVEL=debug" >/etc/systemd/system/systemd-oomd.service.d/debug.conf
systemctl daemon-reload
# if oomd is already running for some reasons, then restart it to make sure the above settings to be applied
if systemctl is-active systemd-oomd.service; then
systemctl restart systemd-oomd.service
fi
systemctl start testsuite-55-testchill.service
systemctl start testsuite-55-testbloat.service
@ -29,16 +39,18 @@ systemctl start testsuite-55-testbloat.service
# Verify systemd-oomd is monitoring the expected units
oomctl | grep "/testsuite-55-workload.slice"
oomctl | grep "1.00%"
oomctl | grep "Default Memory Pressure Duration: 5s"
oomctl | grep "Default Memory Pressure Duration: 2s"
# systemd-oomd watches for elevated pressure for 5 seconds before acting.
systemctl status testsuite-55-testchill.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.
timeout="$(date -ud "2 minutes" +%s)"
while [[ $(date -u +%s) -le $timeout ]]; do
if ! systemctl status testsuite-55-testbloat.service; then
break
fi
sleep 5
sleep 2
done
# testbloat should be killed and testchill should be fine