Skip to content

Commit

Permalink
fix view case (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsy3993 authored Jun 18, 2024
1 parent b0b9290 commit 8d78dd1
Showing 1 changed file with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,26 @@ suite("test_view_and_mv") {
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 checkRestoreAllFinishTimesOf = { checkTable, times -> Boolean
Boolean ret = true
while (times > 0) {
Expand Down Expand Up @@ -180,7 +200,14 @@ suite("test_view_and_mv") {
select user_id, name from ${tableDuplicate0};
"""
// when create materialized view, source cluster will backup again firstly.
// so we check the restore rows
// so we check the backup and restore status

// first, check backup
sleep(15000)
assertTrue(checkBackupFinishTimesOf("${tableDuplicate0}", 60))

// then, check retore
sleep(15000)
assertTrue(checkRestoreRowsTimesOf(2, 30))
assertTrue(checkRestoreFinishTimesOf("${tableDuplicate0}", 30))

Expand Down

0 comments on commit 8d78dd1

Please sign in to comment.