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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 94746b764db branch-2.1: [fix](memory) Fix UT `ThreadMemTrackerMgrTest` 
#44147 (#44936)
94746b764db is described below

commit 94746b764dbff2dcf1caa6537efa2facd3ddab1a
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Dec 6 10:54:12 2024 +0800

    branch-2.1: [fix](memory) Fix UT `ThreadMemTrackerMgrTest` #44147 (#44936)
    
    Cherry-picked from #44147
    
    Co-authored-by: Xinyi Zou <zouxi...@selectdb.com>
---
 be/test/runtime/memory/thread_mem_tracker_mgr_test.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/be/test/runtime/memory/thread_mem_tracker_mgr_test.cpp 
b/be/test/runtime/memory/thread_mem_tracker_mgr_test.cpp
index c1feb43fe91..323b2da5df5 100644
--- a/be/test/runtime/memory/thread_mem_tracker_mgr_test.cpp
+++ b/be/test/runtime/memory/thread_mem_tracker_mgr_test.cpp
@@ -257,7 +257,7 @@ TEST_F(ThreadMemTrackerMgrTest, ReserveMemory) {
 
     int64_t size1 = 4 * 1024;
     int64_t size2 = 4 * 1024 * 1024;
-    int64_t size3 = size2 * 1024;
+    int64_t size3 = size2 * 2;
 
     thread_context->attach_task(TUniqueId(), t, workload_group);
     thread_context->consume_memory(size1);
@@ -281,7 +281,7 @@ TEST_F(ThreadMemTrackerMgrTest, ReserveMemory) {
     // std::abs(-size1 - size1) < SYNC_PROC_RESERVED_INTERVAL_BYTES, not 
update process_reserved_memory.
     EXPECT_EQ(doris::GlobalMemoryArbitrator::process_reserved_memory(), size3 
- size2);
 
-    thread_context->consume_memory(size2 * 1023);
+    thread_context->consume_memory(size2);
     EXPECT_EQ(t->consumption(), size1 + size2 + size3);
     EXPECT_EQ(doris::GlobalMemoryArbitrator::process_reserved_memory(), size1 
+ size1);
 
@@ -408,7 +408,7 @@ TEST_F(ThreadMemTrackerMgrTest, 
NestedSwitchMemTrackerReserveMemory) {
 
     int64_t size1 = 4 * 1024;
     int64_t size2 = 4 * 1024 * 1024;
-    int64_t size3 = size2 * 1024;
+    int64_t size3 = size2 * 2;
 
     thread_context->attach_task(TUniqueId(), t1, workload_group);
     auto st = thread_context->try_reserve_memory(size3);


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

Reply via email to