nixos X tests: wait for logind to link a session to the server

There seems to be some race causing failures if an X command gets in before slim starts the session

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2014-01-22 14:23:56 -05:00
parent 058fd7eeea
commit 51de280c0a
3 changed files with 3 additions and 1 deletions

View File

@ -495,6 +495,8 @@ sub waitForX {
my ($self, $regexp) = @_; my ($self, $regexp) = @_;
$self->nest("waiting for the X11 server", sub { $self->nest("waiting for the X11 server", sub {
retry 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"); my ($status, $out) = $self->execute("xwininfo -root > /dev/null 2>&1");
return 1 if $status == 0; return 1 if $status == 0;
} }

View File

@ -16,7 +16,6 @@
$machine->waitForWindow(qr/Valgrind/); $machine->waitForWindow(qr/Valgrind/);
$machine->sleep(40); # wait until Firefox has finished loading the page $machine->sleep(40); # wait until Firefox has finished loading the page
$machine->screenshot("screen"); $machine->screenshot("screen");
''; '';
} }

View File

@ -17,6 +17,7 @@
testScript = testScript =
'' ''
$machine->waitForX;
$machine->waitForWindow(qr/xfce4-panel/); $machine->waitForWindow(qr/xfce4-panel/);
$machine->sleep(10); $machine->sleep(10);