about summary refs log tree commit diff
path: root/nixos/tests/plotinus.nix
diff options
context:
space:
mode:
authorxeji <36407913+xeji@users.noreply.github.com>2018-05-10 19:38:02 +0200
committerGitHub <noreply@github.com>2018-05-10 19:38:02 +0200
commit558f4b3368b83844837fccd58e9e89490911a1b3 (patch)
tree0c578fbfefbec24108d89c7cd251a1cda3f55f9a /nixos/tests/plotinus.nix
parentf8d047da50dbc7d012a8d322b4d5e5a0b639733c (diff)
downloadnixlib-558f4b3368b83844837fccd58e9e89490911a1b3.tar
nixlib-558f4b3368b83844837fccd58e9e89490911a1b3.tar.gz
nixlib-558f4b3368b83844837fccd58e9e89490911a1b3.tar.bz2
nixlib-558f4b3368b83844837fccd58e9e89490911a1b3.tar.lz
nixlib-558f4b3368b83844837fccd58e9e89490911a1b3.tar.xz
nixlib-558f4b3368b83844837fccd58e9e89490911a1b3.tar.zst
nixlib-558f4b3368b83844837fccd58e9e89490911a1b3.zip
nixos/tests/plotinus: fix non-deterministic failure (#40239)
Test failed sometimes, likely because a window didn't get focus.
Diffstat (limited to 'nixos/tests/plotinus.nix')
-rw-r--r--nixos/tests/plotinus.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/nixos/tests/plotinus.nix b/nixos/tests/plotinus.nix
index 557d65f7960a..9058c59c92de 100644
--- a/nixos/tests/plotinus.nix
+++ b/nixos/tests/plotinus.nix
@@ -15,11 +15,11 @@ import ./make-test.nix ({ pkgs, ... }: {
   testScript =
     ''
       $machine->waitForX;
-      $machine->execute("xterm -e 'gnome-calculator' &");
-      $machine->waitForWindow(qr/Calculator/);
-      $machine->execute("xdotool key ctrl+shift+p");
-      $machine->sleep(1); # wait for the popup
-      $machine->execute("xdotool key p r e f e r e n c e s Return");
+      $machine->succeed("gnome-calculator &");
+      $machine->waitForWindow(qr/gnome-calculator/);
+      $machine->succeed("xdotool search --sync --onlyvisible --class gnome-calculator windowfocus --sync key ctrl+shift+p");
+      $machine->sleep(5); # wait for the popup
+      $machine->succeed("xdotool key --delay 100 p r e f e r e n c e s Return");
       $machine->waitForWindow(qr/Preferences/);
       $machine->screenshot("screen");
     '';