From 81becd3c441771c9c85ec983ba73b4ec3174b56a Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Fri, 29 Sep 2023 03:44:10 +0200 Subject: [PATCH] nixos/lib/test-driver: reduce spam at boot hangs Since 008f9f0cd419bd66e922239e2319fd2b1f347ad8 ("nixos/test-driver: actually use the backdoor message to wait for backdoor"), when boot is still computering, we can get a tons of empty strings in response to the shell. This is not really useful to print and waste the disk space for any CI system that logs them. We stop logging chunks whenever they are empty. --- nixos/lib/test-driver/test_driver/machine.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nixos/lib/test-driver/test_driver/machine.py b/nixos/lib/test-driver/test_driver/machine.py index 2afcbc95c66..4accd2f9d19 100644 --- a/nixos/lib/test-driver/test_driver/machine.py +++ b/nixos/lib/test-driver/test_driver/machine.py @@ -843,6 +843,9 @@ class Machine: while True: chunk = self.shell.recv(1024) + # No need to print empty strings, it means we are waiting. + if len(chunk) == 0: + continue self.log(f"Guest shell says: {chunk!r}") # NOTE: for this to work, nothing must be printed after this line! if b"Spawning backdoor root shell..." in chunk: