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

hellostephen 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 c6897896c4c [fix](UT) Fix cloud UT network_util_test and resource_test 
(#47582)
c6897896c4c is described below

commit c6897896c4ce3bac0fbb1bfddd0477d84aafc49d
Author: Gavin Chou <[email protected]>
AuthorDate: Sat Feb 8 14:31:00 2025 +0800

    [fix](UT) Fix cloud UT network_util_test and resource_test (#47582)
    
    ### What problem does this PR solve?
    
    Related PR: #45255
---
 cloud/test/network_util_test.cpp | 3 +++
 cloud/test/resource_test.cpp     | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/cloud/test/network_util_test.cpp b/cloud/test/network_util_test.cpp
index 06f425f244f..4c1cb59d45f 100644
--- a/cloud/test/network_util_test.cpp
+++ b/cloud/test/network_util_test.cpp
@@ -28,6 +28,8 @@ int main(int argc, char** argv) {
 
 TEST(NetWorkUtilTest, GetLocaHostTest) {
     doris::cloud::config::priority_networks = "";
+    bool enable_loopback_address_for_ms_bak = 
doris::cloud::config::enable_loopback_address_for_ms;
+    doris::cloud::config::enable_loopback_address_for_ms = true;
     // prepare an existed ip for test
     auto ip = 
doris::cloud::get_local_ip(doris::cloud::config::priority_networks);
     std::cout << "get ip: " << ip << " from butil::my_ip_cstr()" << std::endl;
@@ -46,4 +48,5 @@ TEST(NetWorkUtilTest, GetLocaHostTest) {
         doris::cloud::config::priority_networks = ip + "/16";
         
ASSERT_EQ(doris::cloud::get_local_ip(doris::cloud::config::priority_networks), 
ip);
     }
+    doris::cloud::config::enable_loopback_address_for_ms = 
enable_loopback_address_for_ms_bak;
 }
diff --git a/cloud/test/resource_test.cpp b/cloud/test/resource_test.cpp
index c8d53408a04..0d8a2cf89e2 100644
--- a/cloud/test/resource_test.cpp
+++ b/cloud/test/resource_test.cpp
@@ -400,6 +400,8 @@ TEST(ResourceTest, AddDropCluster) {
         auto* ret = try_any_cast<int*>(args[1]);
         *ret = 0;
     });
+    sp->set_call_back("resource_manager::set_safe_drop_time",
+                      [](auto&& args) { *try_any_cast<int64_t*>(args[0]) = -1; 
});
     sp->enable_processing();
 
     auto meta_service = get_meta_service();


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

Reply via email to