Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,38 @@ public void onNext(Frame object) {
executor.shutdownNow();
}
}

@Test
public void asyncLogContainerWithTailAll() throws Exception {
// Create a new client to not affect other tests
String testImage = "icevivek/logreader";

// Pulling image icevivek/logreader
try {
dockerRule.getClient().inspectImageCmd(testImage).exec();
} catch (NotFoundException e) {
LOG.info("Pulling image ");
// need to block until image is pulled completely
dockerRule.getClient().pullImageCmd(testImage)
.withTag("latest")
.start()
.awaitCompletion(30, TimeUnit.SECONDS);
}

LogContainerTestCallback loggingCallback = new LogContainerTestCallback(true);

for (int i = 0; i < 5; ++i) {
CreateContainerResponse container = dockerRule.getClient().createContainerCmd("icevivek/logreader").exec();
dockerRule.getClient().startContainerCmd(container.getId()).exec();
// this essentially test the since=0 case
dockerRule.getClient().logContainerCmd(container.getId())
.withStdErr(true)
.withStdOut(true)
.withFollowStream(true)
.exec(loggingCallback)
.awaitCompletion();
}

assertEquals(748, loggingCallback.getCollectedFrames().size());
}
}