From 9385b3bcfbcc4bd4ca3876e7ecb0ef70049d9d42 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 23 Jul 2024 16:22:29 +0200 Subject: fix(tvix/boot/tests): check nar-bridge being fully up Ensure nar-bridge is healthy before connecting to it, don't just check for the unix socket to be present. We don't have a proper /health endpoint yet, but nix-cache-info works fine for now. Change-Id: I22df2c3b7bffcf52dbd3d00f3ba5382dc06ab03d Reviewed-on: https://cl.tvl.fyi/c/depot/+/12030 Autosubmit: flokli Reviewed-by: yuka Tested-by: BuildkiteCI --- tvix/boot/tests/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix') diff --git a/tvix/boot/tests/default.nix b/tvix/boot/tests/default.nix index 1ea34b186e81..6d7c353bd00b 100644 --- a/tvix/boot/tests/default.nix +++ b/tvix/boot/tests/default.nix @@ -89,8 +89,8 @@ let --otlp=false \ -l $PWD/nar-bridge.sock & - # Wait for the socket to be created. - while [ ! -e $PWD/nar-bridge.sock ]; do sleep 1; done + # Wait for nar-bridge to report healthy. + timeout 22 sh -c "until ${pkgs.curl}/bin/curl -s --unix-socket $PWD/nar-bridge.sock http:///nix-binary-cache; do sleep 1; done" # Upload. We can't use nix copy --to http://…, as it wants access to the nix db. # However, we can use mkBinaryCache to assemble .narinfo and .nar.xz to upload, -- cgit 1.4.1