From: dann frazier Date: Tue, 28 Jan 2020 01:45:17 +0000 (-0700) Subject: test: Synchronize journal before reading from it X-Git-Tag: v245-rc1~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37b9966e2525790843ab302a5b8009853a7905a0;p=thirdparty%2Fsystemd.git test: Synchronize journal before reading from it There's a race condition in the sysuser test where it may try to read entries from the journal before they are available. Fix it by adding a `journalctl --sync` call. BugLink: https://bugs.launchpad.net/bugs/1776654 --- diff --git a/test/TEST-21-SYSUSERS/test.sh b/test/TEST-21-SYSUSERS/test.sh index a1a2e62ab1b..add16ea19fe 100755 --- a/test/TEST-21-SYSUSERS/test.sh +++ b/test/TEST-21-SYSUSERS/test.sh @@ -114,6 +114,7 @@ test_run() { prepare_testdir ${f%.input} cp $f $TESTDIR/usr/lib/sysusers.d/test.conf systemd-sysusers --root=$TESTDIR 2> /dev/null + journalctl --sync journalctl -t systemd-sysusers -o cat | tail -n1 > $TESTDIR/tmp/err if ! diff -u $TESTDIR/tmp/err ${f%.*}.expected-err; then echo "**** Unexpected error output for $f"