From d700b4d24f29c2bf973420a07109ba2f6a9524e5 Mon Sep 17 00:00:00 2001 From: cinereal Date: Sun, 16 Aug 2026 11:36:37 +0200 Subject: [PATCH] nixos/test-driver: keep streaming a container journal that is slow to appear Poll for nspawn containers' journal for as long as needed rather than giving up after ten seconds, ensuring we can still get output on slower nodes. Before this change, resource-constrained environments or node parallelism could make for a situation where it gave up before they loaded, preventing output for the rest of the run. Assisted-by: Claude:claude-opus-5 --- .../test-driver/src/test_driver/machine/__init__.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/nixos/lib/test-driver/src/test_driver/machine/__init__.py b/nixos/lib/test-driver/src/test_driver/machine/__init__.py index b215b0f02b00..ffc7c7517165 100644 --- a/nixos/lib/test-driver/src/test_driver/machine/__init__.py +++ b/nixos/lib/test-driver/src/test_driver/machine/__init__.py @@ -1809,15 +1809,16 @@ class NspawnMachine(BaseMachine): # 1. Wait for the directory to actually be created by the container self.log(f"Waiting for journal at {journal_path}...") - max_attempts = 10 + warn_after = 10 attempts = 0 - while not journal_path.exists() and attempts < max_attempts: + while not journal_path.exists(): + if proc.poll() is not None: + self.log(f"Error: Journal directory {journal_path} never appeared.") + return time.sleep(1) attempts += 1 - - if not journal_path.exists(): - self.log(f"Error: Journal directory {journal_path} never appeared.") - return + if attempts == warn_after: + self.log(f"Still waiting for journal at {journal_path}...") # 2. Start the journalctl process # Using a loop here handles cases where journalctl might exit unexpectedly