From d99e71aa0a8761d27e16e4df04802e45a1e1cb23 Mon Sep 17 00:00:00 2001 From: gdliu3 Date: Fri, 11 Aug 2023 15:41:47 +0800 Subject: [PATCH] [bugfix] Fix testGetErrorInfo case error --- .../seatunnel/engine/e2e/JobExecutionIT.java | 31 ++----------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/JobExecutionIT.java b/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/JobExecutionIT.java index 501e763e3c47..50a828b6c904 100644 --- a/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/JobExecutionIT.java +++ b/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/JobExecutionIT.java @@ -19,15 +19,11 @@ 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; @@ -152,32 +148,9 @@ public void testGetErrorInfo() throws ExecutionException, InterruptedException { jobStatus = clientJobProxy.getJobStatus(); } - CompletableFuture completableFuture = - CompletableFuture.supplyAsync( - () -> { - try { - return RetryUtils.retryWithException( - () -> { - PassiveCompletableFuture 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); - } - }); - - await().atMost(600000, TimeUnit.MILLISECONDS) - .untilAsserted(() -> Assertions.assertTrue(completableFuture.isDone())); + CompletableFuture.supplyAsync(clientJobProxy::waitForJobComplete); - JobResult result = completableFuture.get(); + JobResult result = clientJobProxy.getJobResultCache(); Assertions.assertEquals(result.getStatus(), JobStatus.FAILED); Assertions.assertTrue(result.getError().startsWith("java.lang.NumberFormatException")); }