Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test](build index) enhance build index case for finished state #42630

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ suite("test_build_index_with_clone_fault_injection", "nonConcurrent"){
if (show_build_index && show_build_index.size() > 0) {
def currentState = show_build_index[0].State
def currentMsg = show_build_index[0].Msg
if (currentState == expectedState && currentMsg == expectedMsg) {
logger.info("Attempt ${attempt + 1}: State and Msg match expected values.")
if ((currentState == expectedState && currentMsg == expectedMsg) || currentState == "FINISHED") {
logger.info(currentState+" "+currentMsg)
return
} else {
logger.warn("Attempt ${attempt + 1}: Expected State='${expectedState}' and Msg='${expectedMsg}', but got State='${currentState}' and Msg='${currentMsg}'. Retrying after ${waitSeconds} second(s)...")
Expand Down Expand Up @@ -109,10 +109,8 @@ suite("test_build_index_with_clone_fault_injection", "nonConcurrent"){
// create index on table
sql """ create index idx_k2 on ${tbl}(k2) using inverted """
sql """ build index idx_k2 on ${tbl} """
// sleep 5s to wait for the build index job report table is unstable
sleep(5000)

assertShowBuildIndexWithRetry(tbl, 'WAITING_TXN', 'table is unstable', 3, 5)
assertShowBuildIndexWithRetry(tbl, 'WAITING_TXN', 'table is unstable', 3, 10)

def state = wait_for_last_build_index_on_table_finish(tbl, timeout)
assertEquals(state, "FINISHED")
Expand Down
Loading