git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/tests/gnome3.nix: Speed up test

It turns out that "journalctl -f | grep -m 1 pattern" will block for one more line after "pattern" appears, which can take a long time.

commitbb0ce819b37b57df15c223fd7e9edaaa737678aa authorEelco Dolstra <edolstra@gmail.com> dateThu 29 Dec 2016, 16:19 (10 years ago) parent996e0ef
1 file changed+1−1
nixos/tests/gnome3.nix+1−1
nixos/tests/gnome3.nix+1−1
@@ -29,7 +29,7 @@ import ./make-test.nix ({ pkgs, ...} : {
2929 $machine->succeed("su - alice -c 'DISPLAY=:0.0 gnome-terminal &'");
3030 $machine->succeed("xauth merge ~alice/.Xauthority");
3131 $machine->waitForWindow(qr/Terminal/);
32− $machine->mustSucceed("timeout 900 bash -c 'journalctl -f|grep -m 1 \"GNOME Shell started\"'");
32+ $machine->succeed("timeout 900 bash -c 'while read msg; do if [[ \$msg =~ \"GNOME Shell started\" ]]; then break; fi; done < <(journalctl -f)'");
3333 $machine->sleep(10);
3434 $machine->screenshot("screen");
3535 '';