Skip to content

Commit

Permalink
fixed e2e error
Browse files Browse the repository at this point in the history
  • Loading branch information
sunxiaojian committed Aug 10, 2023
1 parent eab4b96 commit b7c9459
Showing 1 changed file with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@

import org.apache.seatunnel.common.config.Common;
import org.apache.seatunnel.common.config.DeployMode;
import org.apache.seatunnel.common.utils.RetryUtils;
import org.apache.seatunnel.engine.client.SeaTunnelClient;
import org.apache.seatunnel.engine.client.job.ClientJobProxy;
import org.apache.seatunnel.engine.client.job.JobExecutionEnvironment;
import org.apache.seatunnel.engine.common.Constant;
import org.apache.seatunnel.engine.common.config.ConfigProvider;
import org.apache.seatunnel.engine.common.config.JobConfig;
import org.apache.seatunnel.engine.common.utils.ExceptionUtil;
import org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture;
import org.apache.seatunnel.engine.core.job.JobResult;
import org.apache.seatunnel.engine.core.job.JobStatus;
import org.apache.seatunnel.engine.server.SeaTunnelServerStarter;
Expand Down Expand Up @@ -152,11 +156,29 @@ public void testGetErrorInfo() throws ExecutionException, InterruptedException {
CompletableFuture<JobResult> completableFuture =
CompletableFuture.supplyAsync(
() -> {
return clientJobProxy.doWaitForJobComplete().join();
try {
return RetryUtils.retryWithException(
() -> {
PassiveCompletableFuture<JobResult> jobFuture =
clientJobProxy.doWaitForJobComplete();
return jobFuture.get();
},
new RetryUtils.RetryMaterial(
100000,
true,
exception ->
ExceptionUtil.isOperationNeedRetryException(
exception),
Constant.OPERATION_RETRY_SLEEP));
} catch (Exception e) {
throw new RuntimeException(e);
}
});

JobResult result = completableFuture.get();
await().atMost(20000, TimeUnit.MILLISECONDS)
.untilAsserted(() -> Assertions.assertTrue(completableFuture.isDone()));

JobResult result = completableFuture.get();
Assertions.assertEquals(result.getStatus(), JobStatus.FAILED);
Assertions.assertTrue(result.getError().startsWith("java.lang.NumberFormatException"));
}
Expand Down

0 comments on commit b7c9459

Please sign in to comment.