Skip to content

Commit 01f8339

Browse files
authored
[test](auth)Fix backup backup of auth test case (apache#56988)
[test](auth)Fix backup backup of auth test case There is a conflict when creating a backup task in the case. Use the UUID to update the database name and avoid conflicts with other cases.
1 parent aad5e48 commit 01f8339

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

regression-test/suites/auth_call/test_ddl_backup_auth.groovy

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ suite("test_ddl_backup_auth","p0,auth_call") {
2424
int hashCode = randomValue.hashCode()
2525
hashCode = hashCode > 0 ? hashCode : hashCode * (-1)
2626

27+
def label = UUID.randomUUID().toString().replaceAll("-", "")
28+
2729
String user = 'test_ddl_backup_auth_user'
2830
String pwd = 'C123_567p'
29-
String dbName = 'test_ddl_backup_auth_db'
31+
String dbName = 'test_ddl_backup_auth_db_' + label
3032
String tableName = 'test_ddl_backup_auth_tb'
3133
String repositoryName = 'test_ddl_backup_auth_rps'
3234
String backupLabelName = 'test_ddl_backup_auth_backup_label' + hashCode.toString()
@@ -100,12 +102,18 @@ suite("test_ddl_backup_auth","p0,auth_call") {
100102
}
101103
}
102104
sql """grant LOAD_PRIV on ${dbName}.* to ${user}"""
105+
106+
// check backup job not exists
107+
def res = sql """SHOW BACKUP FROM ${dbName};"""
108+
logger.info("res: " + res)
109+
assertTrue(res.size() == 0)
110+
103111
connect(user, "${pwd}", context.config.jdbcUrl) {
104112
sql """BACKUP SNAPSHOT ${dbName}.${backupLabelName}
105113
TO ${repositoryName}
106114
ON (${tableName})
107115
PROPERTIES ("type" = "full");"""
108-
def res = sql """SHOW BACKUP FROM ${dbName};"""
116+
res = sql """SHOW BACKUP FROM ${dbName};"""
109117
logger.info("res: " + res)
110118
assertTrue(res.size() == 1)
111119

0 commit comments

Comments
 (0)