Skip to content

Commit

Permalink
branch-3.0: [regression-test](fix) fix test_show_tablet.groovy bug ru…
Browse files Browse the repository at this point in the history
…nning on mul… #46791 (#46809)

Cherry-picked from #46791

Co-authored-by: shuke <[email protected]>
  • Loading branch information
github-actions[bot] and shuke987 authored Jan 11, 2025
1 parent a402a39 commit 15a3381
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions regression-test/suites/show_p0/test_show_tablet.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,32 @@ suite("test_show_tablet") {
PROPERTIES (
"replication_num" = "1"
);"""
def res = sql """SHOW TABLETS FROM show_tablets_test_t limit 5, 1;"""

logger.info("result: " + res.toString());
assertTrue(res.size() == 0)
def res = sql """ SHOW TABLETS FROM show_tablets_test_t """
if (res.size() == 5) {
// replication num == 1
res = sql """SHOW TABLETS FROM show_tablets_test_t limit 5, 1;"""
logger.info("result: " + res.toString());
assertTrue(res.size() == 0)

res = sql """SHOW TABLETS FROM show_tablets_test_t limit 3, 5;"""
assertTrue(res.size() == 2)
res = sql """SHOW TABLETS FROM show_tablets_test_t limit 3, 5;"""
assertTrue(res.size() == 2)

res = sql """SHOW TABLETS FROM show_tablets_test_t limit 10;"""
assertTrue(res.size() == 5)
res = sql """SHOW TABLETS FROM show_tablets_test_t limit 10;"""
assertTrue(res.size() == 5)
} else if (res.size() == 15) {
// in multi-be cluster and force_olap_table_replication_num=3
// will change to 3 replication even though set "replication_num" = "1" in create table
res = sql """SHOW TABLETS FROM show_tablets_test_t limit 15, 1;"""
logger.info("result: " + res.toString());
assertTrue(res.size() == 0)

res = sql """SHOW TABLETS FROM show_tablets_test_t limit 13, 5;"""
assertTrue(res.size() == 2)

res = sql """SHOW TABLETS FROM show_tablets_test_t limit 15;"""
assertTrue(res.size() == 15)
} else {
assertTrue(1 == 2)
}
}

0 comments on commit 15a3381

Please sign in to comment.