wenzhenghu commented on code in PR #60559:
URL: https://github.com/apache/doris/pull/60559#discussion_r3394433156


##########
regression-test/suites/workload_manager_p0/test_workload_sched_policy.groovy:
##########
@@ -247,4 +247,43 @@ suite("test_workload_sched_policy") {
 
     sql "drop user test_alter_policy_user"
     sql "drop workload policy test_alter_policy"
+
+    // 
============================================================================
+    // Test mixed policy (Username + Query Time)
+    // 
============================================================================
+    
+    // 1. Create a user
+    sql "DROP USER IF EXISTS 'test_policy_user_be'"
+    sql "CREATE USER 'test_policy_user_be'@'%' IDENTIFIED BY '12345'"
+    sql "GRANT SELECT_PRIV ON *.* TO 'test_policy_user_be'@'%'"
+
+    // 2. Create a workload group
+    sql "DROP WORKLOAD GROUP IF EXISTS policy_group_be $forComputeGroupStr"
+    sql "CREATE WORKLOAD GROUP policy_group_be $forComputeGroupStr PROPERTIES 
('max_cpu_percent'='100')"
+    sql "GRANT USAGE_PRIV ON WORKLOAD GROUP 'policy_group_be' TO 
'test_policy_user_be'@'%'"
+
+    // 3. Create a policy with both username (shared metric) and query_time 
(BE metric)
+    sql "DROP WORKLOAD POLICY IF EXISTS test_mixed_policy"
+    
+    sql """
+        CREATE WORKLOAD POLICY test_mixed_policy
+        CONDITIONS(username='test_policy_user_be', query_time > 1000)
+        ACTIONS(cancel_query) 
+        PROPERTIES('workload_group'='${currentCgName}policy_group_be')
+    """
+
+    // 4. Verify policy creation
+    def policy = sql "SELECT * FROM information_schema.workload_policy WHERE 
name='test_mixed_policy'"
+    assertTrue(policy.size() > 0, "Policy should be created successfully")
+
+    // 5. Test execution
+    connect('test_policy_user_be', '12345', context.config.jdbcUrl) {
+        sql "set workload_group = 'policy_group_be'"
+        sql "SELECT 1" 

Review Comment:
   just as comment, this test is just verify fe will not report error 



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