From c6394f7c41e04f90043705d371bde03e7c750fa7 Mon Sep 17 00:00:00 2001 From: oddlama Date: Fri, 5 Jan 2024 21:10:30 +0100 Subject: [PATCH] typesense: fix test failure due to initialization timing --- nixos/tests/typesense.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}' ''; })