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

Check backup/restore state for test insert overwrite case #105

Merged
merged 1 commit into from
Jun 6, 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
22 changes: 22 additions & 0 deletions regression-test/suites/table-sync/test_insert_overwrite.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,26 @@ suite("test_insert_overwrite") {
return ret
}

def checkBackupFinishTimesOf = { checkTable, times -> Boolean
Boolean ret = false
while (times > 0) {
def sqlInfo = sql "SHOW BACKUP FROM ${context.dbName}"
for (List<Object> row : sqlInfo) {
if ((row[4] as String).contains(checkTable)) {
ret = row[3] == "FINISHED"
}
}

if (ret) {
break
} else if (--times > 0) {
sleep(sync_gap_time)
}
}

return ret
}

def checkData = { data, beginCol, value -> Boolean
if (data.size() < beginCol + value.size()) {
return false
Expand Down Expand Up @@ -152,6 +172,8 @@ suite("test_insert_overwrite") {
"""
sql "sync"

sleep(10000)
assertTrue(checkBackupFinishTimesOf("${uniqueTable}", 60))
sleep(10000)
assertTrue(checkRestoreFinishTimesOf("${uniqueTable}", 60))

Expand Down
Loading