From a2cd4f3da8b8d3d5e32aea204e6558fa9d285029 Mon Sep 17 00:00:00 2001 From: atlas Date: Tue, 10 Nov 2026 00:56:23 +0100 Subject: [PATCH] full-setup: diagnose() prints the failed units and the journal tail only On a timed-out wait, diagnose() prints systemctl --failed for the machine or container and the last 50 journal lines of the units waited on. It no longer prints `systemctl status` for them. Only the failure path changes. --- nix/vm-tests/full-setup.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nix/vm-tests/full-setup.nix b/nix/vm-tests/full-setup.nix index 5721387af..ec3a2677c 100644 --- a/nix/vm-tests/full-setup.nix +++ b/nix/vm-tests/full-setup.nix @@ -206,14 +206,13 @@ pkgs.testers.runNixOSTest ( ) def diagnose(unit=None, container=None): - # What a timed-out wait leaves behind: the failed units, and the status - # and the end of the journal of the unit that was waited on. + # What a timed-out wait leaves behind: the failed units and the end of the + # journal of the units that were waited on. where = f"--machine={container} " if container else "" units = [unit] if isinstance(unit, str) else list(unit or []) flags = " ".join(f"-u '{u}'" for u in units) for command in [ f"systemctl {where}--failed --no-legend --no-pager", - *([f"systemctl {where}status --no-pager -n 0 -l {' '.join(units)} | head -c 4000"] if units else []), *([f"journalctl {where}{flags} --no-pager -n 50 | tail -c 6000"] if units else []), ]: print(f"--- {command}")