shuke987 commented on code in PR #65453:
URL: https://github.com/apache/doris/pull/65453#discussion_r3557354894


##########
regression-test/plugins/plugin_index_change.groovy:
##########
@@ -24,21 +24,25 @@ import java.util.regex.Pattern;
 def delta_time = 1000
 
 Suite.metaClass.wait_for_last_build_index_finish = {table_name, OpTimeout ->
-    def useTime = 0
-    for(int t = delta_time; t <= OpTimeout; t += delta_time){
-        def alter_res = sql """SHOW BUILD INDEX WHERE TableName = 
"${table_name}" ORDER BY CreateTime DESC LIMIT 1;"""
+    def finished = false
+    def alter_res = ""
+    for(int t = 0; t <= OpTimeout; t += delta_time){
+        alter_res = sql """SHOW BUILD INDEX WHERE TableName = "${table_name}" 
ORDER BY CreateTime DESC LIMIT 1;"""
         alter_res = alter_res.toString()
         if(alter_res.contains("FINISHED")) {
             logger.info(table_name + " latest alter job finished, detail: " + 
alter_res)
+            finished = true
             break
         } else if (alter_res.contains("CANCELLED")) {
             logger.info(table_name + " latest alter job failed, detail: " + 
alter_res)
             assertTrue(false)
         }
-        useTime = t
+        if (t >= OpTimeout) {
+            break
+        }
         sleep(delta_time)
     }
-    assertTrue(useTime <= OpTimeout, "wait for last build index finish 
timeout")
+    assertTrue(finished, "wait for last build index finish timeout, latest 
result: ${alter_res}")

Review Comment:
   Fixed in 537124f8fb2: the shared column-change wait now requires an explicit 
finished state, stops at the deadline, and reports the latest result on timeout.



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