From ed0727fecd958abf8e10c702cc25c71bb08cf227 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Tue, 11 Aug 2026 15:57:34 +0200 Subject: [PATCH] test: sync the journal before checking it for ordering cycle messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we might get an empty match: TEST-03-JOBS.sh[100]: + IDS_FILE=/tmp/TEST-03-JOBS-CYCLE-IDS-30241 TEST-03-JOBS.sh[314]: + varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Manager.Describe '{}' TEST-03-JOBS.sh[315]: + jq .runtime.TransactionsWithOrderingCycle TEST-03-JOBS.sh[316]: ++ jq length /tmp/TEST-03-JOBS-CYCLE-IDS-30241 TEST-03-JOBS.sh[100]: + [[ 20 -ge 20 ]] TEST-03-JOBS.sh[100]: + for i in {0..19} TEST-03-JOBS.sh[317]: ++ jq -r '.[0]' /tmp/TEST-03-JOBS-CYCLE-IDS-30241 TEST-03-JOBS.sh[100]: + journalctl -b TRANSACTION_ID=48 --grep 'cycle starting with' TEST-03-JOBS.sh[318]: -- No entries -- [FAILED] Failed to start TEST-03-JOBS.service - TEST-03-JOBS. [ !! ] Exiting: unit TEST-03-JOBS.service failed Even though the message was properly emitted: $ journalctl --file TEST-03-JOBS-1.journal -b TRANSACTION_ID=48 --grep 'cycle starting with' Aug 11 14:46:15 H systemd[1]: [🡕] transaction-cycle17.service: Unable to break cycle starting with transaction-cycle17.service/start --- test/units/TEST-03-JOBS.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/units/TEST-03-JOBS.sh b/test/units/TEST-03-JOBS.sh index fec48da0f8..50089c1965 100755 --- a/test/units/TEST-03-JOBS.sh +++ b/test/units/TEST-03-JOBS.sh @@ -126,6 +126,7 @@ done IDS_FILE="/tmp/TEST-03-JOBS-CYCLE-IDS-$RANDOM" varlinkctl call /run/systemd/io.systemd.Manager io.systemd.Manager.Describe '{}' | jq '.runtime.TransactionsWithOrderingCycle' >"$IDS_FILE" [[ "$(jq length "$IDS_FILE")" -ge 20 ]] +journalctl --sync for i in {0..19}; do journalctl -b TRANSACTION_ID="$(jq -r ".[$i]" "$IDS_FILE")" --grep "cycle starting with" done