Skip to content

Commit

Permalink
fix unstable test
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed Apr 14, 2024
1 parent 03bd2a3 commit 67bdf27
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ suite("parse_sql_from_sql_cache") {
sql "select * from test_use_plan_cache12"
assertHasCache "select * from test_use_plan_cache12"

sql "sync"


extraThread("test_cache_user1_thread", {
connect(user = "test_cache_user1", password="DORIS@2024") {
Expand Down Expand Up @@ -321,6 +323,8 @@ suite("parse_sql_from_sql_cache") {
// after partition changed 10s, the sql cache can be used
sleep(10000)

sql "sync"

extraThread("test_cache_user2_thread", {
connect(user = "test_cache_user2", password="DORIS@2024") {
sql "use ${dbName}"
Expand All @@ -342,6 +346,8 @@ suite("parse_sql_from_sql_cache") {
USING (id = 'concat(id, "**")')"""
sql "set enable_nereids_planner=true"

sql "sync"

// after row policy changed, the cache is invalidate
extraThread("test_cache_user2_thread2", {
connect(user = "test_cache_user2", password="DORIS@2024") {
Expand Down Expand Up @@ -377,6 +383,8 @@ suite("parse_sql_from_sql_cache") {
USING (id = 'concat(id, "**")')"""
sql "set enable_nereids_planner=true"

sql "sync"

// after partition changed 10s, the sql cache can be used
sleep(10000)

Expand All @@ -400,6 +408,8 @@ suite("parse_sql_from_sql_cache") {
FOR test_cache_user3"""
sql "set enable_nereids_planner=true"

sql "sync"

// after row policy changed, the cache is invalidate
extraThread("test_cache_user3_thread2", {
connect(user = "test_cache_user3", password="DORIS@2024") {
Expand All @@ -425,6 +435,8 @@ suite("parse_sql_from_sql_cache") {
sql "GRANT SELECT_PRIV ON regression_test.* TO test_cache_user4"
sql "GRANT SELECT_PRIV ON ${dbName}.test_use_plan_cache15 TO test_cache_user4"

sql "sync"

extraThread("test_cache_user4_thread", {
connect(user = "test_cache_user4", password="DORIS@2024") {
sql "use ${dbName}"
Expand All @@ -440,6 +452,8 @@ suite("parse_sql_from_sql_cache") {

sql "REVOKE SELECT_PRIV ON ${dbName}.test_use_plan_cache15 FROM test_cache_user4"

sql "sync"

// after privileges changed, the cache is invalidate
extraThread("test_cache_user4_thread2", {
connect(user = "test_cache_user4", password="DORIS@2024") {
Expand Down

0 comments on commit 67bdf27

Please sign in to comment.