Skip to content

Commit

Permalink
fix except row result is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
seawinde committed Jan 10, 2025
1 parent 4ee37cd commit 3e989d6
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1484,18 +1484,19 @@ class Suite implements GroovyInterceptable {
long startTime = System.currentTimeMillis()
long timeoutTimestamp = startTime + 5 * 60 * 1000 // 5 min
List<String> toCheckTaskRow = new ArrayList<>();
do {
while (timeoutTimestamp > System.currentTimeMillis() && (status != "SUCCESS")) {
result = sql(showTasks)
logger.info("current db is " + context.dbName + "showTasks is " + showTasks)
if (result.isEmpty()) {
logger.info("waitingMTMVTaskFinishedByMvName toCheckTaskRow is empty")
break;
Thread.sleep(1000);
continue;
}
toCheckTaskRow = result.get(0);
status = toCheckTaskRow.get(4)
logger.info("The state of ${showTasks} is ${status}")
Thread.sleep(1000);
} while (timeoutTimestamp > System.currentTimeMillis() && (status == 'PENDING' || status == 'RUNNING' || status == 'NULL'))
}
if (status != "SUCCESS") {
logger.info("status is not success")
}
Expand All @@ -1522,18 +1523,19 @@ class Suite implements GroovyInterceptable {
long startTime = System.currentTimeMillis()
long timeoutTimestamp = startTime + 5 * 60 * 1000 // 5 min
List<String> toCheckTaskRow = new ArrayList<>();
do {
while (timeoutTimestamp > System.currentTimeMillis() && (status != "SUCCESS")) {
result = sql(showTasks)
logger.info("current db is " + context.dbName + "showTasks result: " + result.toString())
if (result.isEmpty()) {
logger.info("waitingMTMVTaskFinishedByMvName toCheckTaskRow is empty")
break;
Thread.sleep(1000);
continue;
}
toCheckTaskRow = result.get(0)
status = toCheckTaskRow.get(4)
logger.info("The state of ${showTasks} is ${status}")
Thread.sleep(1000);
} while (timeoutTimestamp > System.currentTimeMillis() && (status == 'PENDING' || status == 'RUNNING' || status == 'NULL' || status == 'CANCELED'))
}
if (status != "SUCCESS") {
logger.info("status is not success")
assertTrue(result.toString().contains("same table"))
Expand All @@ -1551,7 +1553,7 @@ class Suite implements GroovyInterceptable {
long startTime = System.currentTimeMillis()
long timeoutTimestamp = startTime + 5 * 60 * 1000 // 5 min
List<String> toCheckTaskRow = new ArrayList<>();
do {
while (timeoutTimestamp > System.currentTimeMillis() && (status != 'FINISHED')) {
result = sql(showTasks)
logger.info("crrent db is " + dbName + "showTasks result: " + result.toString())
// just consider current db
Expand All @@ -1562,12 +1564,13 @@ class Suite implements GroovyInterceptable {
}
if (toCheckTaskRow.isEmpty()) {
logger.info("waitingMVTaskFinishedByMvName toCheckTaskRow is empty")
break;
Thread.sleep(1000);
continue;
}
status = toCheckTaskRow.get(8)
logger.info("The state of ${showTasks} is ${status}")
Thread.sleep(1000);
} while (timeoutTimestamp > System.currentTimeMillis() && (status != 'FINISHED'))
}
if (status != "FINISHED") {
logger.info("status is not success")
}
Expand Down

0 comments on commit 3e989d6

Please sign in to comment.