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


##########
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:
   This statement completes before `query_time > 1000` can become true, so the 
policy is never eligible to match and the test only proves that creation 
succeeded. It does not exercise the new FE-to-BE `resourceInfo` propagation or 
BE-side `USERNAME` condition. Please make this run long enough for the workload 
scheduler to cancel it and assert the workload-policy cancellation message, 
including the username condition.



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

Review Comment:
   `git diff --check` reports trailing whitespace in this added block, 
including this line plus the nearby blank lines and the `SELECT 1` line. Please 
strip the trailing spaces so the patch passes the basic whitespace check.



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