From: Yu Watanabe Date: Mon, 20 May 2024 16:53:02 +0000 (+0900) Subject: test: call journalctl --sync just before reading journals X-Git-Tag: v256-rc3~21^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=123acb25605f904c9a52c67f00dfff2b299a7a58;p=thirdparty%2Fsystemd.git test: call journalctl --sync just before reading journals Otherwise, journal entries comes during sleep may not be read. Follow-up for c22a112883a46e302dae587b809c459647363ceb. --- diff --git a/test/units/TEST-60-MOUNT-RATELIMIT.sh b/test/units/TEST-60-MOUNT-RATELIMIT.sh index 77663c0fa2a..440b8d457d5 100755 --- a/test/units/TEST-60-MOUNT-RATELIMIT.sh +++ b/test/units/TEST-60-MOUNT-RATELIMIT.sh @@ -295,9 +295,9 @@ done # Figure out if we have entered the rate limit state. # If the infra is slow we might not enter the rate limit state; in that case skip the exit check. journalctl --sync -if timeout 2m bash -c "until journalctl -u init.scope --since=$TS | grep -q '(mount-monitor-dispatch) entered rate limit'; do journalctl --sync; sleep 1; done"; then +if timeout 2m bash -c "until journalctl -u init.scope --since=$TS | grep -q '(mount-monitor-dispatch) entered rate limit'; do sleep 1; journalctl --sync; done"; then journalctl --sync - timeout 2m bash -c "until journalctl -u init.scope --since=$TS | grep -q '(mount-monitor-dispatch) left rate limit'; do journalctl --sync; sleep 1; done" + timeout 2m bash -c "until journalctl -u init.scope --since=$TS | grep -q '(mount-monitor-dispatch) left rate limit'; do sleep 1; journalctl --sync; done" fi # Verify that the mount units are always cleaned up at the end.