summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorRaito Bezarius <masterancpp@gmail.com>2023-09-29 03:44:10 +0200
committerRaito Bezarius <masterancpp@gmail.com>2023-09-29 03:45:31 +0200
commit81becd3c441771c9c85ec983ba73b4ec3174b56a (patch)
tree5993765880ef075ce2391a5c1be01e8892e09752 /nixos/lib
parent248a83fffc10b627da67fa6b25d2c13fc7542628 (diff)
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.
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/test-driver/test_driver/machine.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nixos/lib/test-driver/test_driver/machine.py b/nixos/lib/test-driver/test_driver/machine.py
index 2afcbc95c6670..4accd2f9d1950 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: