From 363e3096c771732764e2708b585c91c6a7eec57e Mon Sep 17 00:00:00 2001 From: Arian van Putten Date: Sat, 28 Feb 2026 17:54:29 +0100 Subject: [PATCH] nixos/tests/systemd-repart: do not assume structured journal logs in tests systemd-repart and systemd-journal start up in parallel. This means that quite often systemd-repart ends up logging to /dev/kmesg as opposed to the journal. This makes the tests very flakey (see e.g. https://hydra.nixos.org/job/nixos/release-25.11/nixos.tests.systemd-repart.after-initrd.x86_64-linux) Instead we switch to --syslog-identifier which is set for both logs in /dev/kmesg and for journal logs --- nixos/tests/systemd-repart.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/nixos/tests/systemd-repart.nix b/nixos/tests/systemd-repart.nix index 01faf69d6a51..a991709a5c66 100644 --- a/nixos/tests/systemd-repart.nix +++ b/nixos/tests/systemd-repart.nix @@ -110,8 +110,7 @@ in machine.start() machine.wait_for_unit("multi-user.target") - systemd_repart_logs = machine.succeed("journalctl --boot --unit systemd-repart.service") - assert "Growing existing partition 1." in systemd_repart_logs + machine.succeed("journalctl --boot --grep 'Growing existing partition 1.' --identifier systemd-repart") ''; }; @@ -173,8 +172,7 @@ in machine.start() machine.wait_for_unit("multi-user.target") - systemd_repart_logs = machine.succeed("journalctl --boot --unit systemd-repart.service") - assert "Encrypting future partition 2" in systemd_repart_logs + machine.succeed("journalctl --boot --grep 'Encrypting future partition 2' --identifier systemd-repart") assert "/dev/mapper/created-crypt" in machine.succeed("mount") ''; @@ -205,8 +203,7 @@ in machine.start() machine.wait_for_unit("multi-user.target") - systemd_repart_logs = machine.succeed("journalctl --unit systemd-repart.service") - assert "Growing existing partition 1." in systemd_repart_logs + machine.succeed("journalctl --grep 'Growing existing partition 1.' --identifier systemd-repart") ''; }; @@ -273,8 +270,7 @@ in machine.start() machine.wait_for_unit("multi-user.target") - systemd_repart_logs = machine.succeed("journalctl --boot --unit systemd-repart.service") - assert "Adding new partition 2 to partition table." in systemd_repart_logs + machine.succeed("journalctl --boot --grep 'Adding new partition 2 to partition table.' --identifier systemd-repart") ''; };