Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed Jan 6, 2025
1 parent ee8f916 commit b00e64d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ class Suite implements GroovyInterceptable {
return sql
}

<T> T retry(int executeTimes = 3, int intervalMillis = 1000, Closure<T> closure) {
<T> T retry(int executeTimes = 3, int intervalMillis = 1000, Closure<Integer> closure) {
Throwable throwable = null
for (int i = 1; i <= executeTimes; ++i) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import java.util.stream.Collectors

suite("parse_sql_from_sql_cache") {
def assertHasCache = { String sqlStr ->
retry(120, 1000) {
retry(120, 1000) { i ->
if (i > 0) {
sql sqlStr
}
explain {
sql ("physical plan ${sqlStr}")
contains("PhysicalSqlCache")
Expand Down Expand Up @@ -319,13 +322,13 @@ suite("parse_sql_from_sql_cache") {

sql "sync"


extraThread("test_cache_user1_thread", {
connect("test_cache_user1", "DORIS@2024") {
sql "use ${dbName}"
sql "set enable_nereids_planner=true"
sql "set enable_fallback_to_original_planner=false"
sql "set enable_sql_cache=true"
sql "ADMIN SET FRONTEND CONFIG ('cache_last_version_interval_second' = '10')"

assertNoCache "select * from test_use_plan_cache12"
}
Expand Down Expand Up @@ -363,6 +366,7 @@ suite("parse_sql_from_sql_cache") {
sql "set enable_nereids_planner=true"
sql "set enable_fallback_to_original_planner=false"
sql "set enable_sql_cache=true"
sql "ADMIN SET FRONTEND CONFIG ('cache_last_version_interval_second' = '10')"

assertNoCache "select * from test_use_plan_cache13"
sql "select * from test_use_plan_cache13"
Expand All @@ -385,6 +389,7 @@ suite("parse_sql_from_sql_cache") {
sql "set enable_nereids_planner=true"
sql "set enable_fallback_to_original_planner=false"
sql "set enable_sql_cache=true"
sql "ADMIN SET FRONTEND CONFIG ('cache_last_version_interval_second' = '10')"

assertNoCache "select * from test_use_plan_cache13"
}
Expand Down Expand Up @@ -428,6 +433,7 @@ suite("parse_sql_from_sql_cache") {
sql "set enable_nereids_planner=true"
sql "set enable_fallback_to_original_planner=false"
sql "set enable_sql_cache=true"
sql "ADMIN SET FRONTEND CONFIG ('cache_last_version_interval_second' = '10')"

assertNoCache "select * from test_use_plan_cache14"
sql "select * from test_use_plan_cache14"
Expand All @@ -449,6 +455,7 @@ suite("parse_sql_from_sql_cache") {
sql "set enable_nereids_planner=true"
sql "set enable_fallback_to_original_planner=false"
sql "set enable_sql_cache=true"
sql "ADMIN SET FRONTEND CONFIG ('cache_last_version_interval_second' = '10')"

assertNoCache "select * from test_use_plan_cache14"
}
Expand Down Expand Up @@ -483,6 +490,7 @@ suite("parse_sql_from_sql_cache") {
sql "set enable_nereids_planner=true"
sql "set enable_fallback_to_original_planner=false"
sql "set enable_sql_cache=true"
sql "ADMIN SET FRONTEND CONFIG ('cache_last_version_interval_second' = '10')"

assertNoCache "select * from test_use_plan_cache15"
sql "select * from test_use_plan_cache15"
Expand All @@ -500,6 +508,7 @@ suite("parse_sql_from_sql_cache") {
sql "set enable_nereids_planner=true"
sql "set enable_fallback_to_original_planner=false"
sql "set enable_sql_cache=true"
sql "ADMIN SET FRONTEND CONFIG ('cache_last_version_interval_second' = '10')"

test {
sql ("select * from ${dbName}.test_use_plan_cache15")
Expand Down Expand Up @@ -659,8 +668,6 @@ suite("parse_sql_from_sql_cache") {

log.info("connect to fe: ${fe1}")
connect( context.config.jdbcUser, context.config.jdbcPassword, "jdbc:mysql://${fe1}") {
sql "ADMIN SET FRONTEND CONFIG ('cache_last_version_interval_second' = '10')"

sql "use ${dbName}"

createTestTable "test_use_plan_cache18"
Expand Down Expand Up @@ -688,6 +695,7 @@ suite("parse_sql_from_sql_cache") {
sql "set enable_nereids_planner=true"
sql "set enable_fallback_to_original_planner=false"
sql "set enable_sql_cache=true"
sql "ADMIN SET FRONTEND CONFIG ('cache_last_version_interval_second' = '10')"

assertNoCache "select * from test_use_plan_cache18"
sql "select * from test_use_plan_cache18"
Expand Down

0 comments on commit b00e64d

Please sign in to comment.