]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: wait for coredump to appear before parsing
authorLuca Boccassi <luca.boccassi@gmail.com>
Fri, 30 May 2025 21:08:39 +0000 (22:08 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 31 May 2025 01:01:30 +0000 (10:01 +0900)
A new core was added to the test, but the loop counter was not increased
to wait for it, so the test races against systemd-coredump's processing.

This failed at least once in debci:

8015s [   32.227813] TEST-87-AUX-UTILS-VM.sh[1038]: + coredumpctl info COREDUMP_TIMESTAMP=1679509902000000
8015s [   32.228684] TEST-87-AUX-UTILS-VM.sh[1723]: No coredumps found.

Follow-up for 0c49e0049b7665bb7769a13ef346fef92e1ad4d6

Fixes https://github.com/systemd/systemd/issues/37666

test/units/TEST-87-AUX-UTILS-VM.coredump.sh

index ce4a2c9ed1538e82070a378c6dfac7c16ef79cf5..5b3a148ca57e9bd218da5e1a33dd6c4efca48904 100755 (executable)
@@ -201,7 +201,7 @@ journalctl -b -n 1 --output=export --output-fields=MESSAGE,COREDUMP COREDUMP_EXE
 journalctl -b -n 1 --output=export --output-fields=MESSAGE,COREDUMP COREDUMP_EXE="/usr/bin/test-dump" |
     /usr/lib/systemd/systemd-coredump --backtrace $$ 0 0 6 1679509902 12345 youmachine 1
 # Wait a bit for the coredumps to get processed
-timeout 30 bash -c "while [[ \$(coredumpctl list -q --no-legend $$ | wc -l) -lt 2 ]]; do sleep 1; done"
+timeout 30 bash -c "while [[ \$(coredumpctl list -q --no-legend $$ | wc -l) -lt 3 ]]; do sleep 1; done"
 coredumpctl info $$
 coredumpctl info COREDUMP_TIMESTAMP=1679509900000000
 coredumpctl info COREDUMP_TIMESTAMP=1679509901000000