Commit 81becd3c authored by Raito Bezarius's avatar Raito Bezarius
Browse files

nixos/lib/test-driver: reduce spam at boot hangs

Since 008f9f0c
 ("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.
parent 248a83ff
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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: