From 636647ce0367f843ace4b40ad8062289d32ed11d Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 23 Jul 2024 16:21:56 +0200 Subject: [PATCH] fix(tvix/boot/tests): use grpc health check Ensure the service is healthy before connecting to it, don't just check for the unix socket to be present. Change-Id: If6501828677c247910d91f35b860960802084691 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12029 Autosubmit: flokli Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/boot/tests/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tvix/boot/tests/default.nix b/tvix/boot/tests/default.nix index 101b71819..1ea34b186 100644 --- a/tvix/boot/tests/default.nix +++ b/tvix/boot/tests/default.nix @@ -65,8 +65,8 @@ let --otlp=false \ daemon -l $PWD/tvix-store.sock & - # Wait for the socket to be created. - while [ ! -e $PWD/tvix-store.sock ]; do sleep 1; done + # Wait for the service to report healthy. + timeout 22 sh -c "until ${pkgs.ip2unix}/bin/ip2unix -r out,path=$PWD/tvix-store.sock ${pkgs.grpc-health-check}/bin/grpc-health-check --address 127.0.0.1 --port 8080; do sleep 1; done" # Export env vars so that subsequent tvix-store commands will talk to # our tvix-store daemon over the unix socket.