From 80861fb03279dc0b391b1336079fb205b2c3a953 Mon Sep 17 00:00:00 2001 From: Matej Cotman Date: Thu, 15 Feb 2024 22:46:32 +0200 Subject: [PATCH] lemmy-server: fix tests by waiting until backend is ready with 10s timeout --- nixos/tests/lemmy.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/tests/lemmy.nix b/nixos/tests/lemmy.nix index e8d747f89a9e..d93df3646837 100644 --- a/nixos/tests/lemmy.nix +++ b/nixos/tests/lemmy.nix @@ -51,7 +51,8 @@ in with subtest("the backend starts and responds"): server.wait_for_open_port(${toString backendPort}) - server.succeed("curl --fail localhost:${toString backendPort}/api/v3/site") + # wait until succeeds, it just needs few seconds for migrations, but lets give it 10s max + server.wait_until_succeeds("curl --fail localhost:${toString backendPort}/api/v3/site", 10) with subtest("the UI starts and responds"): server.wait_for_unit("lemmy-ui.service")