stdpain commented on code in PR #3384:
URL: https://github.com/apache/brpc/pull/3384#discussion_r3567868116


##########
test/bthread_timer_thread_unittest.cpp:
##########
@@ -254,4 +256,113 @@ TEST(TimerThreadTest, schedule_and_unschedule_in_task) {
     keeper5.expect_first_run();
 }
 
+static void noop_routine(void*) {}
+
+// Tasks that are unscheduled after being pulled into the timer thread's
+// internal heap must not stay there (occupying a pooled Task slot) until
+// their run_time. With large timeouts that would let memory grow ~ qps *
+// timeout. The timer thread should sweep them out and keep the heap bounded.
+TEST(TimerThreadTest, sweep_unscheduled_tasks_in_heap) {
+    // Lower the sweep threshold so the test doesn't need a huge heap.
+    GFLAGS_NAMESPACE::SetCommandLineOption(
+        "brpc_timer_heap_sweep_min_size", "512");

Review Comment:
   UT update



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to