]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: call journalctl --sync just before reading journals
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 20 May 2024 16:53:02 +0000 (01:53 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 20 May 2024 16:53:07 +0000 (01:53 +0900)
Otherwise, journal entries comes during sleep may not be read.

Follow-up for c22a112883a46e302dae587b809c459647363ceb.

test/units/TEST-60-MOUNT-RATELIMIT.sh

index 77663c0fa2adaa828ab9fb49064b1e1e6b0aa6b3..440b8d457d56341595dc983fce537c1ee1e705e6 100755 (executable)
@@ -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.