about summary refs log tree commit diff
path: root/tvix/boot/tests
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-07-23T14·22+0200
committerclbot <clbot@tvl.fyi>2024-07-23T14·47+0000
commit9385b3bcfbcc4bd4ca3876e7ecb0ef70049d9d42 (patch)
tree9194245905d046683c3e60dcf9ae8b2561ea6328 /tvix/boot/tests
parent636647ce0367f843ace4b40ad8062289d32ed11d (diff)
fix(tvix/boot/tests): check nar-bridge being fully up r/8410
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 <flokli@flokli.de>
Reviewed-by: yuka <yuka@yuka.dev>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/boot/tests')
-rw-r--r--tvix/boot/tests/default.nix4
1 files changed, 2 insertions, 2 deletions
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,