This is an automated email from the ASF dual-hosted git repository.
kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 67993ce1937 [fix](test)Fix unstable test drop index fault #38768
(#38773)
67993ce1937 is described below
commit 67993ce1937241f1bb7d5eab09c4aca60c2eb13b
Author: qiye <[email protected]>
AuthorDate: Fri Aug 2 17:52:18 2024 +0800
[fix](test)Fix unstable test drop index fault #38768 (#38773)
---
...index_builder_drop_index_fault_injection.groovy | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git
a/regression-test/suites/fault_injection_p0/test_index_builder_drop_index_fault_injection.groovy
b/regression-test/suites/fault_injection_p0/test_index_builder_drop_index_fault_injection.groovy
index 0df3bc018d2..9e28f8e62b5 100644
---
a/regression-test/suites/fault_injection_p0/test_index_builder_drop_index_fault_injection.groovy
+++
b/regression-test/suites/fault_injection_p0/test_index_builder_drop_index_fault_injection.groovy
@@ -18,6 +18,24 @@
import org.codehaus.groovy.runtime.IOGroovyMethods
suite("test_index_builder_drop_index_fault_injection", "nonConcurrent") {
+ def timeout = 60000
+ def delta_time = 1000
+ def alter_res = "null"
+ def useTime = 0
+ def wait_for_latest_op_on_table_finish = { table_name, OpTimeout ->
+ for(int t = delta_time; t <= OpTimeout; t += delta_time){
+ alter_res = sql """SHOW ALTER TABLE COLUMN WHERE TableName =
"${table_name}" ORDER BY CreateTime DESC LIMIT 1;"""
+ alter_res = alter_res.toString()
+ if(alter_res.contains("FINISHED")) {
+ sleep(3000) // wait change table state to normal
+ logger.info(table_name + " latest alter job finished, detail:
" + alter_res)
+ break
+ }
+ useTime = t
+ sleep(delta_time)
+ }
+ assertTrue(useTime <= OpTimeout, "wait_for_latest_op_on_table_finish
timeout")
+ }
def runTest = { indexTbName ->
sql """ insert into ${indexTbName} values(1, "json love anny", "json",
"anny",1); """
sql "sync"
@@ -33,6 +51,7 @@ suite("test_index_builder_drop_index_fault_injection",
"nonConcurrent") {
try {
GetDebugPoint().enableDebugPointForAllBEs("index_builder.update_inverted_index_info.drop_index",
[indexes_count: 3])
sql "DROP INDEX index_int ON ${indexTbName}"
+ wait_for_latest_op_on_table_finish(indexTbName, timeout)
show_result = sql_return_maparray "show index from ${indexTbName}"
logger.info("show index from " + indexTbName + " result: " +
show_result)
assertEquals(show_result.size(), 3)
@@ -46,6 +65,7 @@ suite("test_index_builder_drop_index_fault_injection",
"nonConcurrent") {
try {
GetDebugPoint().enableDebugPointForAllBEs("index_builder.update_inverted_index_info.drop_index",
[indexes_count: 2])
sql "DROP INDEX index_str_k2 ON ${indexTbName}"
+ wait_for_latest_op_on_table_finish(indexTbName, timeout)
show_result = sql_return_maparray "show index from ${indexTbName}"
logger.info("show index from " + indexTbName + " result: " +
show_result)
assertEquals(show_result.size(), 2)
@@ -58,6 +78,7 @@ suite("test_index_builder_drop_index_fault_injection",
"nonConcurrent") {
try {
GetDebugPoint().enableDebugPointForAllBEs("index_builder.update_inverted_index_info.drop_index",
[indexes_count: 1])
sql "DROP INDEX index_str_k4 ON ${indexTbName}"
+ wait_for_latest_op_on_table_finish(indexTbName, timeout)
show_result = sql_return_maparray "show index from ${indexTbName}"
logger.info("show index from " + indexTbName + " result: " +
show_result)
assertEquals(show_result.size(), 1)
@@ -69,6 +90,7 @@ suite("test_index_builder_drop_index_fault_injection",
"nonConcurrent") {
try {
GetDebugPoint().enableDebugPointForAllBEs("index_builder.update_inverted_index_info.drop_index",
[indexes_count: 0])
sql "DROP INDEX index_k5 ON ${indexTbName}"
+ wait_for_latest_op_on_table_finish(indexTbName, timeout)
show_result = sql_return_maparray "show index from ${indexTbName}"
logger.info("show index from " + indexTbName + " result: " +
show_result)
assertEquals(show_result.size(), 0)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]