summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/lib/test-driver/Machine.pm2
-rw-r--r--nixos/tests/firefox.nix1
-rw-r--r--nixos/tests/xfce.nix1
3 files changed, 3 insertions, 1 deletions
diff --git a/nixos/lib/test-driver/Machine.pm b/nixos/lib/test-driver/Machine.pm
index a28214ea934..8bef3d67b8d 100644
--- a/nixos/lib/test-driver/Machine.pm
+++ b/nixos/lib/test-driver/Machine.pm
@@ -495,6 +495,8 @@ sub waitForX {
     my ($self, $regexp) = @_;
     $self->nest("waiting for the X11 server", sub {
         retry sub {
+            my ($status, $out) = $self->execute("journalctl -bu systemd-logind | grep Linked");
+            return 0 if $status != 0;
             my ($status, $out) = $self->execute("xwininfo -root > /dev/null 2>&1");
             return 1 if $status == 0;
         }
diff --git a/nixos/tests/firefox.nix b/nixos/tests/firefox.nix
index ca634ffcf1e..d6599be13c9 100644
--- a/nixos/tests/firefox.nix
+++ b/nixos/tests/firefox.nix
@@ -16,7 +16,6 @@
       $machine->waitForWindow(qr/Valgrind/);
       $machine->sleep(40); # wait until Firefox has finished loading the page
       $machine->screenshot("screen");
-
     '';
 
 }
diff --git a/nixos/tests/xfce.nix b/nixos/tests/xfce.nix
index 9f9692f8a01..50ce54c918b 100644
--- a/nixos/tests/xfce.nix
+++ b/nixos/tests/xfce.nix
@@ -17,6 +17,7 @@
 
   testScript =
     ''
+      $machine->waitForX;
       $machine->waitForWindow(qr/xfce4-panel/);
       $machine->sleep(10);