about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authoroddlama <oddlama@oddlama.org>2024-01-05 21:10:30 +0100
committeroddlama <oddlama@oddlama.org>2024-01-07 13:04:59 +0100
commitc6394f7c41e04f90043705d371bde03e7c750fa7 (patch)
tree56c0b2a8f5d22a3f467efd53abfa97f6d4129b76 /nixos/tests
parente3d0c844283d488c97c210d28aea230817c2c04a (diff)
downloadnixlib-c6394f7c41e04f90043705d371bde03e7c750fa7.tar
nixlib-c6394f7c41e04f90043705d371bde03e7c750fa7.tar.gz
nixlib-c6394f7c41e04f90043705d371bde03e7c750fa7.tar.bz2
nixlib-c6394f7c41e04f90043705d371bde03e7c750fa7.tar.lz
nixlib-c6394f7c41e04f90043705d371bde03e7c750fa7.tar.xz
nixlib-c6394f7c41e04f90043705d371bde03e7c750fa7.tar.zst
nixlib-c6394f7c41e04f90043705d371bde03e7c750fa7.zip
typesense: fix test failure due to initialization timing
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/typesense.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/tests/typesense.nix b/nixos/tests/typesense.nix
index 4f07a2e194be..87ed248257ea 100644
--- a/nixos/tests/typesense.nix
+++ b/nixos/tests/typesense.nix
@@ -18,6 +18,7 @@ in {
   testScript = ''
     machine.wait_for_unit("typesense.service")
     machine.wait_for_open_port(${toString testPort})
-    assert machine.succeed("curl --fail http://localhost:${toString testPort}/health") == '{"ok":true}'
+    # After waiting for the port, typesense still hasn't initialized the database, so wait until we can connect successfully
+    assert machine.wait_until_succeeds("curl --fail http://localhost:${toString testPort}/health") == '{"ok":true}'
   '';
 })