Skip to content

Commit

Permalink
[Improve] Optimize Test Cases `CheckpointTimeOutTest.testJobLevelChec…
Browse files Browse the repository at this point in the history
…kpointTimeOut` (#5403)
  • Loading branch information
liugddx authored Aug 31, 2023
1 parent 74530a0 commit b3ba5eb
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
import org.junit.jupiter.api.Test;

import com.hazelcast.internal.serialization.Data;
import lombok.extern.slf4j.Slf4j;

import java.util.Collections;
import java.util.concurrent.TimeUnit;

import static org.awaitility.Awaitility.await;

@Slf4j
public class CheckpointTimeOutTest extends AbstractSeaTunnelServerTest {

public static String CONF_PATH = "stream_fake_to_console_checkpointTimeOut.conf";
Expand All @@ -45,20 +47,20 @@ public void testJobLevelCheckpointTimeOut() {

await().atMost(120000, TimeUnit.MILLISECONDS)
.untilAsserted(
() -> {
Assertions.assertTrue(
server.getCoordinatorService()
.getJobStatus(JOB_ID)
.equals(JobStatus.RUNNING));
});
() ->
Assertions.assertEquals(
server.getCoordinatorService().getJobStatus(JOB_ID),
JobStatus.RUNNING));

await().atMost(120000, TimeUnit.MILLISECONDS)
await().atMost(360000, TimeUnit.MILLISECONDS)
.untilAsserted(
() -> {
Assertions.assertTrue(
server.getCoordinatorService()
.getJobStatus(JOB_ID)
.equals(JobStatus.FAILED));
log.info(
"Job status: {}",
server.getCoordinatorService().getJobStatus(JOB_ID));
Assertions.assertEquals(
server.getCoordinatorService().getJobStatus(JOB_ID),
JobStatus.FAILED);
});
}

Expand Down

0 comments on commit b3ba5eb

Please sign in to comment.