about summary refs log tree commit diff
path: root/nixos/tests/seafile.nix
diff options
context:
space:
mode:
authorGreizgh <greizgh@ephax.org>2022-10-09 18:22:43 +0200
committerWinter <winter@winter.cafe>2022-10-09 13:31:13 -0400
commit987d2f575aff1da36d964a6e3fd3e4ba42445a76 (patch)
tree3c325084505ba8ad0bf98ff7995505587b689812 /nixos/tests/seafile.nix
parentf4aa32330098a5108aace65ffea283a757deaa07 (diff)
nixos/seafile: avoid sleep in tests
Replace sleep statements with wait_until_succeeds
Diffstat (limited to 'nixos/tests/seafile.nix')
-rw-r--r--nixos/tests/seafile.nix12
1 files changed, 3 insertions, 9 deletions
diff --git a/nixos/tests/seafile.nix b/nixos/tests/seafile.nix
index 6eec8b1fbe55c..78e735f4fed73 100644
--- a/nixos/tests/seafile.nix
+++ b/nixos/tests/seafile.nix
@@ -79,18 +79,14 @@ import ./make-test-python.nix ({ pkgs, ... }:
               f"seaf-cli download -l {libid} -s http://server -u admin\@example.com -p seafile_password -d . >&2"
           )
 
-          client1.sleep(3)
-
-          client1.succeed("seaf-cli status |grep synchronized >&2")
+          client1.wait_until_succeeds("seaf-cli status |grep synchronized >&2")
 
           client1.succeed("ls -la >&2")
           client1.succeed("ls -la test01 >&2")
 
           client1.execute("echo bla > test01/first_file")
 
-          client1.sleep(2)
-
-          client1.succeed("seaf-cli status |grep synchronized >&2")
+          client1.wait_until_succeeds("seaf-cli status |grep synchronized >&2")
 
       with subtest("client2 sync"):
           client2.wait_for_unit("default.target")
@@ -110,9 +106,7 @@ import ./make-test-python.nix ({ pkgs, ... }:
               f"seaf-cli download -l {libid} -s http://server -u admin\@example.com -p seafile_password -d . >&2"
           )
 
-          client2.sleep(3)
-
-          client2.succeed("seaf-cli status |grep synchronized >&2")
+          client2.wait_until_succeeds("seaf-cli status |grep synchronized >&2")
 
           client2.succeed("ls -la test01 >&2")