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

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


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 7a4ea1a91a2 branch-3.0: [fix](UT) Fix cloud UT network_util_test and 
resource_test #47582 (#47641)
7a4ea1a91a2 is described below

commit 7a4ea1a91a233c9132b88d9da6938882dca3e9fb
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Feb 8 15:41:27 2025 +0800

    branch-3.0: [fix](UT) Fix cloud UT network_util_test and resource_test 
#47582 (#47641)
    
    Cherry-picked from #47582
    
    Co-authored-by: Gavin Chou <[email protected]>
    Co-authored-by: Dongyang Li <[email protected]>
---
 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