Skip to content

Commit e7ef706

Browse files
committed
fixed e2e
1 parent 1c65c0f commit e7ef706

File tree

1 file changed

+19
-10
lines changed
  • seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e

1 file changed

+19
-10
lines changed

seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/JobExecutionIT.java

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919

2020
import org.apache.seatunnel.common.config.Common;
2121
import org.apache.seatunnel.common.config.DeployMode;
22+
import org.apache.seatunnel.common.utils.RetryUtils;
2223
import org.apache.seatunnel.engine.client.SeaTunnelClient;
2324
import org.apache.seatunnel.engine.client.job.ClientJobProxy;
2425
import org.apache.seatunnel.engine.client.job.JobExecutionEnvironment;
26+
import org.apache.seatunnel.engine.common.Constant;
2527
import org.apache.seatunnel.engine.common.config.ConfigProvider;
2628
import org.apache.seatunnel.engine.common.config.JobConfig;
2729
import org.apache.seatunnel.engine.common.utils.PassiveCompletableFuture;
@@ -143,24 +145,31 @@ public void testGetErrorInfo() throws ExecutionException, InterruptedException {
143145
JobExecutionEnvironment jobExecutionEnv =
144146
engineClient.createExecutionContext(filePath, jobConfig);
145147
final ClientJobProxy clientJobProxy = jobExecutionEnv.execute();
146-
JobStatus jobStatus = clientJobProxy.getJobStatus();
147-
while (jobStatus == JobStatus.RUNNING) {
148-
Thread.sleep(1000L);
149-
jobStatus = clientJobProxy.getJobStatus();
150-
}
151148

152149
CompletableFuture<JobResult> completableFuture =
153150
CompletableFuture.supplyAsync(
154151
() -> {
155-
PassiveCompletableFuture<JobResult> jobFuture =
156-
clientJobProxy.doWaitForJobComplete();
157-
return jobFuture.join();
152+
try {
153+
return RetryUtils.retryWithException(
154+
() -> {
155+
PassiveCompletableFuture<JobResult> jobFuture =
156+
clientJobProxy.doWaitForJobComplete();
157+
return jobFuture.get();
158+
},
159+
new RetryUtils.RetryMaterial(
160+
100000,
161+
true,
162+
exception -> true,
163+
Constant.OPERATION_RETRY_SLEEP));
164+
} catch (Exception e) {
165+
throw new RuntimeException(e);
166+
}
158167
});
159168

160-
await().atMost(600000, TimeUnit.MILLISECONDS)
169+
await().atMost(6000000, TimeUnit.MILLISECONDS)
161170
.untilAsserted(() -> Assertions.assertTrue(completableFuture.isDone()));
162171

163-
JobResult result = completableFuture.join();
172+
JobResult result = completableFuture.get();
164173
Assertions.assertEquals(result.getStatus(), JobStatus.FAILED);
165174
Assertions.assertTrue(result.getError().startsWith("java.lang.NumberFormatException"));
166175
}

0 commit comments

Comments
 (0)