about summary refs log tree commit diff
path: root/tvix/store/src/tests/import.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-06-09T15·22+0300
committerclbot <clbot@tvl.fyi>2023-06-12T10·24+0000
commitaa7bdc1199bfbb69091dda942a82812257e30bc4 (patch)
tree933964562f5746274ef6df59cfa956aca73b0807 /tvix/store/src/tests/import.rs
parent7725eb53ad67730e92a3839a6c10925c668e5586 (diff)
refactor(tvix/store): use Arc instead of Box r/6273
This allows us to blob services without closing them before putting them
in a box.
We currently need to use Arc<_>, not Rc<_>, because the GRPC wrappers
require Sync.

Change-Id: I679c5f06b62304f5b0456cfefe25a0a881de7c84
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8738
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/store/src/tests/import.rs')
-rw-r--r--tvix/store/src/tests/import.rs22
1 files changed, 13 insertions, 9 deletions
diff --git a/tvix/store/src/tests/import.rs b/tvix/store/src/tests/import.rs
index 3498cf444640..ab6557421947 100644
--- a/tvix/store/src/tests/import.rs
+++ b/tvix/store/src/tests/import.rs
@@ -18,8 +18,8 @@ fn symlink() {
     .unwrap();
 
     let root_node = ingest_path(
-        &mut gen_blob_service(),
-        &mut gen_directory_service(),
+        gen_blob_service(),
+        gen_directory_service(),
         tmpdir.path().join("doesntmatter"),
     )
     .expect("must succeed");
@@ -39,11 +39,11 @@ fn single_file() {
 
     std::fs::write(tmpdir.path().join("root"), HELLOWORLD_BLOB_CONTENTS).unwrap();
 
-    let mut blob_service = gen_blob_service();
+    let blob_service = gen_blob_service();
 
     let root_node = ingest_path(
-        &mut blob_service,
-        &mut gen_directory_service(),
+        blob_service.clone(),
+        gen_directory_service(),
         tmpdir.path().join("root"),
     )
     .expect("must succeed");
@@ -75,11 +75,15 @@ fn complicated() {
     // File ``keep/.keep`
     std::fs::write(tmpdir.path().join("keep").join(".keep"), vec![]).unwrap();
 
-    let mut blob_service = gen_blob_service();
-    let mut directory_service = gen_directory_service();
+    let blob_service = gen_blob_service();
+    let directory_service = gen_directory_service();
 
-    let root_node = ingest_path(&mut blob_service, &mut directory_service, tmpdir.path())
-        .expect("must succeed");
+    let root_node = ingest_path(
+        blob_service.clone(),
+        directory_service.clone(),
+        tmpdir.path(),
+    )
+    .expect("must succeed");
 
     // ensure root_node matched expectations
     assert_eq!(