]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-04-JOURNAL: add one more missing journalctl --sync
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 28 Jul 2025 23:25:23 +0000 (08:25 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 29 Jul 2025 03:07:36 +0000 (12:07 +0900)
Fixes the following failure:
```
TEST-04-JOURNAL.sh[124]: + add_logs_filtering_override delegated-cgroup-filtering.service 01-discard-hello '~hello'
TEST-04-JOURNAL.sh[124]: + local unit=delegated-cgroup-filtering.service
TEST-04-JOURNAL.sh[124]: + local override_name=01-discard-hello
TEST-04-JOURNAL.sh[124]: + local 'log_filter=~hello'
TEST-04-JOURNAL.sh[124]: + mkdir -p /run/systemd/system/delegated-cgroup-filtering.service.d/
TEST-04-JOURNAL.sh[124]: + echo -ne '[Service]\nLogFilterPatterns=~hello'
TEST-04-JOURNAL.sh[124]: + NEEDS_RELOAD=1
TEST-04-JOURNAL.sh[1408]: ++ run_service_and_fetch_logs delegated-cgroup-filtering.service
TEST-04-JOURNAL.sh[1408]: ++ local unit=delegated-cgroup-filtering.service
TEST-04-JOURNAL.sh[1408]: ++ [[ -n 1 ]]
TEST-04-JOURNAL.sh[1408]: ++ systemctl daemon-reload
TEST-04-JOURNAL.sh[1408]: ++ NEEDS_RELOAD=
TEST-04-JOURNAL.sh[1408]: ++ systemctl start delegated-cgroup-filtering.service
TEST-04-JOURNAL.sh[1408]: ++ journalctl --sync
TEST-04-JOURNAL.sh[1408]: ++ journalctl -q -u delegated-cgroup-filtering.service -I -p notice
TEST-04-JOURNAL.sh[124]: + [[ -z Jul 28 22:41:41 H delegated_cgroup_filtering_payload.sh[1448]: child_process: hello, world!
TEST-04-JOURNAL.sh[124]: Jul 28 22:41:41 H delegated_cgroup_filtering_payload.sh[1448]: child_process: hello, people! ]]
TEST-04-JOURNAL.sh[124]: + at_exit
```

test/integration-tests/TEST-04-JOURNAL/TEST-04-JOURNAL.units/delegated_cgroup_filtering_payload_child.sh

index 2d67ad9a388ce2e2256a1bfeeec863a62b207c0e..bd1cd41fa7f31aa3620c52cf4c6993d0239f209f 100755 (executable)
@@ -5,4 +5,7 @@ echo $$ >/sys/fs/cgroup/system.slice/delegated-cgroup-filtering.service/the_chil
 
 echo "child_process: hello, world!"
 echo "child_process: hello, people!"
-sleep .15
+
+# If the service finishes extremely fast, journald cannot find the source of the
+# stream. Hence, we need to call 'journalctl --sync' before service finishes.
+journalctl --sync