From 30e0c320666f8ecaf37f6d966e45c40f988cce78 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 13 Nov 2023 14:32:24 +0200 Subject: refactor(tvix/castore/tonic): make async, support wait-connect=? This moves the sync `channel::from_url` to a async `tonic::channel_from_url`. It now allows connecting non-lazily if `wait- connect=1` is set in the URL params. Also, make the pingpong tests for blobsvc and directorysvc use the wait- connect=1 codepath. Change-Id: Ibeea33117c8121814627e7f6aba0e943ae2e92ca Reviewed-on: https://cl.tvl.fyi/c/depot/+/10030 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster --- tvix/castore/src/blobservice/grpc.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'tvix/castore/src/blobservice/grpc.rs') diff --git a/tvix/castore/src/blobservice/grpc.rs b/tvix/castore/src/blobservice/grpc.rs index 85863c29197f..9cc4f340dbf7 100644 --- a/tvix/castore/src/blobservice/grpc.rs +++ b/tvix/castore/src/blobservice/grpc.rs @@ -285,10 +285,16 @@ mod tests { // prepare a client let grpc_client = { - let url = url::Url::parse(&format!("grpc+unix://{}", socket_path.display())) - .expect("must parse"); - let client = - BlobServiceClient::new(crate::channel::from_url(&url).expect("must succeed")); + let url = url::Url::parse(&format!( + "grpc+unix://{}?wait-connect=1", + socket_path.display() + )) + .expect("must parse"); + let client = BlobServiceClient::new( + crate::tonic::channel_from_url(&url) + .await + .expect("must succeed"), + ); GRPCBlobService::from_client(client) }; -- cgit 1.4.1