PHILO-HE commented on code in PR #10092:
URL:
https://github.com/apache/incubator-gluten/pull/10092#discussion_r2218291063
##########
gluten-flink/ut/src/test/java/org/apache/gluten/table/runtime/stream/custom/NexmarkTest.java:
##########
@@ -127,6 +130,19 @@ private void executeQuery(StreamTableEnvironment tEnv,
String queryFileName) {
if (!insertQuery.isEmpty()) {
TableResult insertResult = tEnv.executeSql(insertQuery);
assertThat(insertResult.getJobClient().isPresent()).isTrue();
Review Comment:
In line 126, should `waitForJobCompletion` also be called to wait for the
table creation.
##########
gluten-flink/ut/src/test/java/org/apache/gluten/table/runtime/stream/custom/NexmarkTest.java:
##########
@@ -127,6 +130,19 @@ private void executeQuery(StreamTableEnvironment tEnv,
String queryFileName) {
if (!insertQuery.isEmpty()) {
TableResult insertResult = tEnv.executeSql(insertQuery);
assertThat(insertResult.getJobClient().isPresent()).isTrue();
Review Comment:
Move into waitForJobCompletion. And use assertTrue for simplicity.
##########
gluten-flink/ut/src/test/java/org/apache/gluten/table/runtime/stream/custom/NexmarkTest.java:
##########
@@ -127,6 +130,19 @@ private void executeQuery(StreamTableEnvironment tEnv,
String queryFileName) {
if (!insertQuery.isEmpty()) {
TableResult insertResult = tEnv.executeSql(insertQuery);
assertThat(insertResult.getJobClient().isPresent()).isTrue();
+ try {
+ waitForJobCompletion(insertResult, 30000);
+ } catch (InterruptedException | ExecutionException | TimeoutException e)
{
+ throw new RuntimeException("Query execution failed: " + queryFileName,
e);
+ }
+ }
+ }
+
+ private void waitForJobCompletion(TableResult result, long timeoutMs)
+ throws InterruptedException, ExecutionException, TimeoutException {
+ if (result.getJobClient().isPresent()) {
Review Comment:
Looks this must true. Then, just add an assert check. And remove the if
check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]