This is an automated email from the ASF dual-hosted git repository.
gavinchou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 64e4ac94d6b [fix](cloud) Reset FDB test globals before exit (#64549)
64e4ac94d6b is described below
commit 64e4ac94d6b4f702bd8cf6e404bf20fd527cf8cd
Author: Gavin Chou <[email protected]>
AuthorDate: Wed Jun 17 00:48:06 2026 +0800
[fix](cloud) Reset FDB test globals before exit (#64549)
### What
The affected cloud tests keep FDB-related objects in global/static
storage. Reset them explicitly before returning from test main or before
early return paths so FoundationDB resources are destroyed before
process teardown.
### Validation
- sh format_code.sh cloud/test/fdb_injection_test.cpp
- sh format_code.sh cloud/test/mem_txn_kv_test.cpp
- sh format_code.sh cloud/test/txn_kv_test.cpp
- sh format_code.sh cloud/test/txn_lazy_commit_test.cpp
- sh run-cloud-ut.sh --run --fdb "fdb_cluster0:[email protected]:4500"
--filter "fdb_injection_test:*"
- sh run-cloud-ut.sh --run --fdb "fdb_cluster0:[email protected]:4500"
--filter "mem_txn_kv_test:*"
- sh run-cloud-ut.sh --run --fdb "fdb_cluster0:[email protected]:4500"
--filter "txn_kv_test:*"
- sh run-cloud-ut.sh --run --fdb "fdb_cluster0:[email protected]:4500"
--filter "txn_lazy_commit_test:*"
---
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]