github-actions[bot] commented on code in PR #69255:
URL: https://github.com/apache/doris/pull/69255#discussion_r4358195381


##########
be/test/udf/python/python_server_test.cpp:
##########
@@ -965,15 +1048,370 @@ TEST_F(PythonServerTest, 
EnsurePoolInitializedForDifferentVersionsDoesNotShareVe
             << "Both version pools must enter fork before either process 
starts";
 }
 
-// ============================================================================
-// PythonServerManager::_check_and_recreate_processes() - health-check 
recreation test
-// ============================================================================
+TEST_F(PythonServerTest, FunctionsWithSameRuntimeHaveIndependentFixedPools) {
+    PythonServerManager mgr;
+    setup_doris_home();
+    auto python_path = create_fake_python_with_socket_creation();
+    PythonVersion version("3.9.16", test_dir_, python_path);
+    PythonUDFMeta first;
+    first.id = 101;
+    first.pool_size = 1;
+    PythonUDFMeta second;
+    second.id = 102;
+    second.pool_size = 2;
+    auto first_result = mgr._ensure_pool_initialized(first, version);
+    ASSERT_TRUE(first_result.has_value()) << first_result.error().to_string();
+    auto second_result = mgr._ensure_pool_initialized(second, version);
+    ASSERT_TRUE(second_result.has_value()) << 
second_result.error().to_string();
+    ASSERT_TRUE(mgr.wait_for_process_pool_initialized_for_test(101, 
std::chrono::seconds(5)));
+    ASSERT_TRUE(mgr.wait_for_process_pool_initialized_for_test(102, 
std::chrono::seconds(5)));
+    auto first_pool = mgr.process_pool_snapshot_for_test(101);
+    auto second_pool = mgr.process_pool_snapshot_for_test(102);
+    ASSERT_EQ(first_pool.size(), 1);
+    ASSERT_EQ(second_pool.size(), 2);

Review Comment:
   [P2] Make multi-worker tests respect the CPU pool cap
   
   On a one-CPU host or cgroup-limited runner, the new `min(meta.pool_size, 
CpuInfo::num_cores())` creates only one process for `second`, so this 
unconditional size-2 assertion fails even though the pool behaves correctly. 
The adapted `EnsurePoolInitializedSucceedsWithOneStuckWorkerAndOneUsableWorker` 
also now launches only its deliberately stuck worker and fails initialization; 
the previous explicit global limit of 2 allowed both workers. Derive 
sizes/indexing from the effective pool size, and skip or control the CPU count 
for scenarios that require at least two workers.



-- 
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