summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorLassulus <github@lassul.us>2022-01-21 11:33:03 +0100
committerGitHub <noreply@github.com>2022-01-21 11:33:03 +0100
commit0defcc063b61f97ef735279ae106fe6fa5da42ee (patch)
tree749f635da11e6a8dfc958c284f430bf2669ddfb8 /nixos
parent6578beccdb9cb060920739140bc861f567609e9a (diff)
parent8a1d379992a58edc9453d10649601c6cc7fdad6c (diff)
downloadnixpkgs-0defcc063b61f97ef735279ae106fe6fa5da42ee.tar
nixpkgs-0defcc063b61f97ef735279ae106fe6fa5da42ee.tar.gz
nixpkgs-0defcc063b61f97ef735279ae106fe6fa5da42ee.tar.bz2
nixpkgs-0defcc063b61f97ef735279ae106fe6fa5da42ee.tar.lz
nixpkgs-0defcc063b61f97ef735279ae106fe6fa5da42ee.tar.xz
nixpkgs-0defcc063b61f97ef735279ae106fe6fa5da42ee.tar.zst
nixpkgs-0defcc063b61f97ef735279ae106fe6fa5da42ee.zip
Merge pull request #155894 from ivanbrennan/xmonad-tests-remove-sleeps
nixosTests.xmonad: avoid sleep()
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/xmonad.nix11
1 files changed, 4 insertions, 7 deletions
diff --git a/nixos/tests/xmonad.nix b/nixos/tests/xmonad.nix
index a14d4b819eb..a2fb38e53bd 100644
--- a/nixos/tests/xmonad.nix
+++ b/nixos/tests/xmonad.nix
@@ -52,7 +52,7 @@ let
 in {
   name = "xmonad";
   meta = with pkgs.lib.maintainers; {
-    maintainers = [ nequissimus ];
+    maintainers = [ nequissimus ivanbrennan ];
   };
 
   machine = { pkgs, ... }: {
@@ -90,8 +90,7 @@ in {
 
     # original config has a keybinding that creates somefile
     machine.send_key("alt-ctrl-t")
-    machine.sleep(1)
-    machine.succeed("stat /tmp/somefile")
+    machine.wait_for_file("/tmp/somefile")
 
     # set up the new config
     machine.succeed("mkdir -p ${user.home}/.xmonad")
@@ -103,15 +102,13 @@ in {
 
     # new config has a keybinding that deletes somefile
     machine.send_key("alt-ctrl-r")
-    machine.sleep(1)
-    machine.fail("stat /tmp/somefile")
+    machine.wait_until_fails("stat /tmp/somefile", timeout=30)
 
     # restart with the old config, and confirm the old keybinding is back
     machine.succeed("rm /tmp/oldXMonad")
     machine.send_key("alt-q")
     machine.wait_for_file("/tmp/oldXMonad")
     machine.send_key("alt-ctrl-t")
-    machine.sleep(1)
-    machine.succeed("stat /tmp/somefile")
+    machine.wait_for_file("/tmp/somefile")
   '';
 })