This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new 3f661b41136 branch-4.1: [fix](cloud) Reset FDB test globals before 
exit #64549 (#64576)
3f661b41136 is described below

commit 3f661b4113631baf72ed232ad453cfe4ebf62799
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Jun 17 15:50:22 2026 +0800

    branch-4.1: [fix](cloud) Reset FDB test globals before exit #64549 (#64576)
    
    Cherry-picked from #64549
    
    Co-authored-by: Gavin Chou <[email protected]>
---
 cloud/test/fdb_injection_test.cpp   | 2 ++
 cloud/test/mem_txn_kv_test.cpp      | 8 +++-----
 cloud/test/txn_kv_test.cpp          | 7 +++----
 cloud/test/txn_lazy_commit_test.cpp | 8 ++++----
 4 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/cloud/test/fdb_injection_test.cpp 
b/cloud/test/fdb_injection_test.cpp
index a06184c6a23..d343fe6b118 100644
--- a/cloud/test/fdb_injection_test.cpp
+++ b/cloud/test/fdb_injection_test.cpp
@@ -103,6 +103,7 @@ int main(int argc, char** argv) {
     int ret = RUN_ALL_TESTS();
     if (ret != 0) {
         std::cerr << "run first round of tests failed" << std::endl;
+        meta_service.reset();
         return ret;
     }
 
@@ -169,6 +170,7 @@ int main(int argc, char** argv) {
             if (ret != 0) {
                 std::cerr << "run test failed, sync_point=" << name << ", 
err=" << err
                           << ", msg=" << fdb_get_error(err) << std::endl;
+                meta_service.reset();
                 return ret;
             }
         }
diff --git a/cloud/test/mem_txn_kv_test.cpp b/cloud/test/mem_txn_kv_test.cpp
index f376827bf0a..543a404f16e 100644
--- a/cloud/test/mem_txn_kv_test.cpp
+++ b/cloud/test/mem_txn_kv_test.cpp
@@ -48,12 +48,10 @@ int main(int argc, char** argv) {
         std::cout << "exit inti FdbTxnKv error" << std::endl;
         return -1;
     }
-    DORIS_CLOUD_DEFER {
-        fdb_txn_kv.reset();
-    };
-
     ::testing::InitGoogleTest(&argc, argv);
-    return RUN_ALL_TESTS();
+    int ret = RUN_ALL_TESTS();
+    fdb_txn_kv.reset();
+    return ret;
 }
 
 static void put_and_get_test(std::shared_ptr<cloud::TxnKv> txn_kv) {
diff --git a/cloud/test/txn_kv_test.cpp b/cloud/test/txn_kv_test.cpp
index 126ce1fa91d..6aed92cadf7 100644
--- a/cloud/test/txn_kv_test.cpp
+++ b/cloud/test/txn_kv_test.cpp
@@ -59,10 +59,9 @@ int main(int argc, char** argv) {
     config::init(nullptr, true);
     ::testing::InitGoogleTest(&argc, argv);
     init_txn_kv();
-    DORIS_CLOUD_DEFER {
-        txn_kv.reset();
-    };
-    return RUN_ALL_TESTS();
+    int ret = RUN_ALL_TESTS();
+    txn_kv.reset();
+    return ret;
 }
 
 TEST(TxnKvTest, Network) {
diff --git a/cloud/test/txn_lazy_commit_test.cpp 
b/cloud/test/txn_lazy_commit_test.cpp
index 6ff0742505f..b1bb8b3a62a 100644
--- a/cloud/test/txn_lazy_commit_test.cpp
+++ b/cloud/test/txn_lazy_commit_test.cpp
@@ -101,9 +101,6 @@ int main(int argc, char** argv) {
 
     // Initialize FDB
     get_fdb_txn_kv();
-    DORIS_CLOUD_DEFER {
-        txn_kv.reset();
-    };
 
     auto s3_producer_pool = 
std::make_shared<SimpleThreadPool>(config::recycle_pool_parallelism);
     s3_producer_pool->start();
@@ -116,7 +113,10 @@ int main(int argc, char** argv) {
             RecyclerThreadPoolGroup(std::move(s3_producer_pool), 
std::move(recycle_tablet_pool),
                                     std::move(group_recycle_function_pool));
 
-    return RUN_ALL_TESTS();
+    int ret = RUN_ALL_TESTS();
+    thread_group = RecyclerThreadPoolGroup();
+    txn_kv.reset();
+    return ret;
 }
 namespace doris::cloud {
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to