test: sync journal before reading journal

Otherwise, expected lines may not be processed or not sync()ed to disk.

Fixes #32712.
This commit is contained in:
Yu Watanabe
2024-05-17 07:46:02 +02:00
committed by Daan De Meyer
parent 71f0487173
commit c22a112883
+2 -2
View File
@@ -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.