nixos/tests/vbox: Make GUI startup more robust.
Sometimes, keys aren't properly recognized the first time, so in order to make sure they get through, always resend the key again on retry. In this case the worst that could happen is that the VM is started over and over again, but never in parallel, so that's fine because we're checking for successful startup 10 seconds after the keypress. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
55b218160d
commit
1165a243f8
@ -244,6 +244,7 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let
|
||||
for (my $i = 0; $i <= 120; $i += 10) {
|
||||
$machine->sleep(10);
|
||||
return if checkRunning_${name};
|
||||
eval { $_[0]->() } if defined $_[0];
|
||||
}
|
||||
die "VirtualBox VM didn't start up within 2 minutes";
|
||||
}
|
||||
@ -335,7 +336,9 @@ in {
|
||||
$machine->screenshot("gui_manager_started");
|
||||
$machine->sendKeys("ret");
|
||||
$machine->screenshot("gui_manager_sent_startup");
|
||||
waitForStartup_simple;
|
||||
waitForStartup_simple (sub {
|
||||
$machine->sendKeys("ret");
|
||||
});
|
||||
$machine->screenshot("gui_started");
|
||||
waitForVMBoot_simple;
|
||||
$machine->screenshot("gui_booted");
|
||||
|
Loading…
Reference in New Issue
Block a user