Skip to content

Commit e8e5a6e

Browse files
committed
tests: use sync instead of flush
flush doesn't sync a journal -> tests sometimes fail
1 parent c7bb287 commit e8e5a6e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/TEST-04-JOURNAL/test-journal.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,44 @@ set -o pipefail
1010
ID=$(journalctl --new-id128 | sed -n 2p)
1111
>/expected
1212
printf $'\n\n\n' | systemd-cat -t "$ID" --level-prefix false
13-
journalctl --flush
13+
journalctl --sync
1414
journalctl -b -o cat -t "$ID" >/output
1515
cmp /expected /output
1616

1717
ID=$(journalctl --new-id128 | sed -n 2p)
1818
>/expected
1919
printf $'<5>\n<6>\n<7>\n' | systemd-cat -t "$ID" --level-prefix true
20-
journalctl --flush
20+
journalctl --sync
2121
journalctl -b -o cat -t "$ID" >/output
2222
cmp /expected /output
2323

2424
# Remove trailing spaces
2525
ID=$(journalctl --new-id128 | sed -n 2p)
2626
printf "Trailing spaces\n">/expected
2727
printf $'<5>Trailing spaces \t \n' | systemd-cat -t "$ID" --level-prefix true
28-
journalctl --flush
28+
journalctl --sync
2929
journalctl -b -o cat -t "$ID" >/output
3030
cmp /expected /output
3131

3232
ID=$(journalctl --new-id128 | sed -n 2p)
3333
printf "Trailing spaces\n">/expected
3434
printf $'Trailing spaces \t \n' | systemd-cat -t "$ID" --level-prefix false
35-
journalctl --flush
35+
journalctl --sync
3636
journalctl -b -o cat -t "$ID" >/output
3737
cmp /expected /output
3838

3939
# Don't remove leading spaces
4040
ID=$(journalctl --new-id128 | sed -n 2p)
4141
printf $' \t Leading spaces\n'>/expected
4242
printf $'<5> \t Leading spaces\n' | systemd-cat -t "$ID" --level-prefix true
43-
journalctl --flush
43+
journalctl --sync
4444
journalctl -b -o cat -t "$ID" >/output
4545
cmp /expected /output
4646

4747
ID=$(journalctl --new-id128 | sed -n 2p)
4848
printf $' \t Leading spaces\n'>/expected
4949
printf $' \t Leading spaces\n' | systemd-cat -t "$ID" --level-prefix false
50-
journalctl --flush
50+
journalctl --sync
5151
journalctl -b -o cat -t "$ID" >/output
5252
cmp /expected /output
5353

0 commit comments

Comments
 (0)