From b172c804b0995cbd74960c534452b19eaaf4a2af Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sat, 7 Oct 2023 23:01:18 +0200 Subject: refactor(tvix/castore): use DuplexStream instead of unix socket We can use DuplexStream to create to bidirectional pairs, which avoids manually waiting for unix sockets to pop up and connect, and creating temporary directoires to create the unix sockets in. Turns out, we also don't actually need to spawn the server in a separate runtime, it works just fine these days. This might be due to all the sync barriers in between being gone. Change-Id: I6b79823bc6209cbcb343b7a498c64a2ba6e0aee7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9562 Autosubmit: flokli Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/castore/src/directoryservice/grpc.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tvix/castore/src/directoryservice') diff --git a/tvix/castore/src/directoryservice/grpc.rs b/tvix/castore/src/directoryservice/grpc.rs index b24e8da9d1f5..70302c3305da 100644 --- a/tvix/castore/src/directoryservice/grpc.rs +++ b/tvix/castore/src/directoryservice/grpc.rs @@ -339,7 +339,6 @@ impl DirectoryPutter for GRPCPutter { mod tests { use core::time; use futures::StreamExt; - use tempfile::TempDir; use crate::{ directoryservice::DirectoryService, @@ -349,11 +348,9 @@ mod tests { #[tokio::test] async fn test() { - let tempdir = TempDir::new().expect("must succeed"); // create the GrpcDirectoryService - let directory_service = super::GRPCDirectoryService::from_client( - gen_directorysvc_grpc_client(tempdir.path()).await, - ); + let directory_service = + super::GRPCDirectoryService::from_client(gen_directorysvc_grpc_client().await); // try to get DIRECTORY_A should return Ok(None) assert_eq!( -- cgit 1.4.1