Skip to content

Commit

Permalink
test: wait for journal to rotate in testLogs
Browse files Browse the repository at this point in the history
In our CI the testLogs sometimes does not get a `START` and then fails.
From the failed log it looks like this is due to journal being rotated.
The user test case already sleeps to let journalctl settle so now we
unify this approach.

Nov 08 13:13:09 ubuntu systemd[1]: Started test.service - Test Service.
Nov 08 13:13:09 ubuntu test-service[2427]: START
Nov 08 13:13:09 ubuntu systemd-journald[271]: Received client request to rotate journal.

Nov 08 13:19:51 ubuntu systemd-journald[271]: Received client request to rotate journal.
Nov 08 13:19:52 ubuntu test-service[2480]: START
Nov 08 13:19:57 ubuntu test-service[2480]: WORKING
  • Loading branch information
jelly committed Nov 8, 2023
1 parent f959a07 commit faee455
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/verify/check-system-services
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ trap "echo STOP" 0
if [ $(id -u) -eq 0 ]; then
journalctl --sync
else
# increase the chance for journal to catch up
sleep 5
fi
# increase the chance for journal to catch up
sleep 5
echo START
while true; do
sleep 5
Expand Down

0 comments on commit faee455

Please sign in to comment.