liurenjie1024 commented on code in PR #428:
URL: https://github.com/apache/iceberg-rust/pull/428#discussion_r1663378624


##########
crates/catalog/glue/tests/glue_catalog_test.rs:
##########
@@ -92,6 +96,24 @@ async fn set_test_fixture(func: &str) -> TestFixture {
     }
 }
 
+async fn lazy_reuse_dc() -> Arc<TestFixture> {
+    let mut guard = TEST_FIXTURE
+        .get_or_init(|| Mutex::new(Weak::new()))
+        .lock()
+        .await;
+
+    let maybe_tf = guard.upgrade();
+
+    if let Some(tf) = maybe_tf {
+        tf
+    } else {
+        let tf = Arc::new(start_dc("reuse").await);

Review Comment:
   ```suggestion
           let tf = Arc::new(start_dc("glue").await);
   ```
   To make things more scalable, we should use unique and meaningful name.



##########
crates/catalog/glue/tests/glue_catalog_test.rs:
##########
@@ -92,6 +96,24 @@ async fn set_test_fixture(func: &str) -> TestFixture {
     }
 }
 
+async fn lazy_reuse_dc() -> Arc<TestFixture> {

Review Comment:
   This approach still risks starting docker multi time. How about using 
[dtor](https://docs.rs/ctor/0.2.8/ctor/attr.dtor.html) function to simplify it?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to