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


##########
be/test/udf/python/python_server_test.cpp:
##########
@@ -304,6 +312,39 @@ TEST_F(PythonServerTest, 
ShutdownAfterFailedInitializationDoesNotCrash) {
     EXPECT_NO_THROW(mgr.shutdown());
 }
 
+TEST_F(PythonServerTest, ClearUdafStateCacheWithoutProcessesIsNoOp) {
+    PythonServerManager mgr;
+
+    EXPECT_NO_THROW(mgr.clear_udaf_state_cache(12345));
+}
+
+TEST_F(PythonServerTest, ClearModuleCacheWithoutProcessesIsNoOp) {
+    PythonServerManager mgr;
+
+    auto status = mgr.clear_module_cache("/tmp/python_udf_cache");
+    EXPECT_TRUE(status.ok()) << status.to_string();
+}
+
+TEST_F(PythonServerTest, BroadcastActionWithInvalidProcessUriReturnsError) {
+    PythonServerManager mgr;
+    PythonVersion version("3.9.16", test_dir_, test_dir_ + "/bin/python3");
+    ProcessPtr process = create_sleep_process();
+    ASSERT_NE(process, nullptr);
+    ASSERT_TRUE(process->is_alive());
+    process->_uri = "invalid-python-flight-uri";
+
+    mgr.set_process_pool_for_test(version, {process});
+    auto status = mgr._broadcast_action_to_processes(
+            "clear_udaf_state_cache", R"({"function_id": 12345})", 
"function_id=12345");

Review Comment:
   This test will not compile as written. `_broadcast_action_to_processes()` is 
declared after `private:` in `PythonServerManager`, and `PythonServerTest` is 
not a friend and does not use a `BE_TEST` public wrapper for this method. 
Please either test through the public `clear_udaf_state_cache()` path or expose 
a test-only wrapper under `#ifdef BE_TEST` instead of calling the private 
method directly.



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