Skip to content

Commit

Permalink
Trying to stabilize the containerLogsWithTty test
Browse files Browse the repository at this point in the history
  • Loading branch information
gesellix committed Nov 15, 2021
1 parent 0fb6b55 commit 95ef7d3
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public void run() {
}

@Test
public void containerLogsWithTty() {
public void containerLogsWithTty() throws InterruptedException {
imageApi.imageCreate(testImage.getImageName(), null, null, testImage.getImageTag(), null, null, null, null, null);

ContainerCreateRequest containerCreateRequest = new ContainerCreateRequest(
Expand All @@ -342,8 +342,9 @@ public void containerLogsWithTty() {
);
containerApi.containerCreate(containerCreateRequest, "container-logs-with-tty-test");
containerApi.containerStart("container-logs-with-tty-test", null);
Thread.sleep(500);

Duration timeout = Duration.of(5, SECONDS);
Duration timeout = Duration.of(10, SECONDS);
LogFrameStreamCallback callback = new LogFrameStreamCallback();

new Thread(() -> containerApi.containerLogs(
Expand All @@ -366,7 +367,9 @@ public void run() {
catch (InterruptedException e) {
e.printStackTrace();
}
assertSame(callback.frames.stream().findAny().get().getStreamType(), Frame.StreamType.RAW);
Optional<Frame> anyFrame = callback.frames.stream().findAny();
assertTrue(anyFrame.isPresent());
assertSame(anyFrame.get().getStreamType(), Frame.StreamType.RAW);

removeContainer(engineApiClient, "container-logs-with-tty-test");
}
Expand Down

0 comments on commit 95ef7d3

Please sign in to comment.