sosreport / sos

A unified tool for collecting system logs and other debug information
http://sos.rtfd.org
GNU General Public License v2.0
508 stars 542 forks source link

[tests] LogsSizeLimitTest can fail on a fresh VM due to default LineMax #3153

Open pmoravec opened 1 year ago

pmoravec commented 1 year ago

In LogsSizeLimitTest, we fill journals by generating 10M log entries (https://github.com/sosreport/sos/blob/main/tests/report_tests/plugin_tests/logs.py#L50-L64). This does not always result in 100M (or future 20M(?)) journalctl data, since journald has default limit LineMax=48K, causing a log line is truncated to 48K only.

Then, we get false alarms in "failing" tests tests/report_tests/plugin_tests/logs.py:LogsSizeLimitTest.test_journal_tailed_and_linked and tests/report_tests/plugin_tests/logs.py:LogsSizeLimitTest.test_string_not_in_manifest.

pmoravec commented 1 year ago

A workaround for a tested system is to add sort-of:

LineMax=10M
SystemMaxUse=10G
RuntimeMaxUse=1G

to /etc/systemd/journald.conf and restarting the service:

systemctl restart systemd-journald.service

but our test should more respect the system defaults (https://www.freedesktop.org/software/systemd/man/journald.conf.html).