test: fix a race condition with the journal test

The docs are slightly ambiguous here but it appears a call to
sd_journal_next() is required at least once before the actual data
message.

journalctl positions the cursor with sd_journal_seek_tail() followed by
sd_journal_seek_previous(). The actual enty is then fetched with
sd_journal_next().

Let's do the same here and let's hope this fixes the current race
condition with the test sometimes failing.
This commit is contained in:
Peter Hutterer 2021-10-11 13:15:29 +10:00 committed by Wim Taymans
parent 4b831021fb
commit 6df8ce3031

View file

@ -478,6 +478,7 @@ PWTEST(logger_journal)
}
sd_journal_seek_tail(journal);
sd_journal_next(journal);
spa_logt_info(iface, &topic, "MARK\n");
while ((rc = sd_journal_next(journal)) > 0) {
@ -555,6 +556,7 @@ PWTEST(logger_journal_chain)
}
sd_journal_seek_tail(journal);
sd_journal_next(journal);
spa_logt_info(iface, &topic, "MARK\n");
while ((rc = sd_journal_next(journal)) > 0) {