From: Yu Watanabe Date: Fri, 17 May 2024 04:03:44 +0000 (+0900) Subject: test: sync journal before reading journal X-Git-Tag: v256-rc3~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c22a112883a46e302dae587b809c459647363ceb;p=thirdparty%2Fsystemd.git test: sync journal before reading journal Otherwise, expected lines may not be processed or not sync()ed to disk. Fixes #32712. --- diff --git a/test/units/TEST-60-MOUNT-RATELIMIT.sh b/test/units/TEST-60-MOUNT-RATELIMIT.sh index d205a93a86b..b01c5dc7bf0 100755 --- a/test/units/TEST-60-MOUNT-RATELIMIT.sh +++ b/test/units/TEST-60-MOUNT-RATELIMIT.sh @@ -286,8 +286,8 @@ 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. -if timeout 2m bash -c "until journalctl -u init.scope --since=$TS | grep -q '(mount-monitor-dispatch) entered rate limit'; do sleep 1; done"; then - timeout 2m bash -c "until journalctl -u init.scope --since=$TS | grep -q '(mount-monitor-dispatch) left rate limit'; do sleep 1; done" +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 + 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" fi # Verify that the mount units are always cleaned up at the end.