testcontainers / testcontainers/testcontainers-java
[Enhancement]: make execInContainer asynchronous
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
Module
Core
Proposal
In function org.testcontainers.containers.ExecInContainerPattern#execInContainer(com.github.dockerjava.api.DockerClient, com.github.dockerjava.api.command.InspectContainerResponse, java.nio.charset.Charset, java.lang.String...)
I found this part of code:
try (FrameConsumerResultCallback callback = new FrameConsumerResultCallback()) {
callback.addConsumer(OutputFrame.OutputType.STDOUT, stdoutConsumer);
callback.addConsumer(OutputFrame.OutputType.STDERR, stderrConsumer);
dockerClient.execStartCmd(execCreateCmdResponse.getId()).exec(callback).awaitCompletion();
}
It seems like this part of code is producing the result in a synchronous and blocking pattern.
This seems to have the impact on the logging and makes it impossible to see the logs as they arrive.
Is it possible to make this asynchronous?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with org.testcontainers.containers.ExecInContainerPattern#execInContainer and inspect the shown FrameConsumerResultCallback and execStartCmd flow. Determine how asynchronous execution should expose output as it arrives without blocking, then verify that logging is observable during execution and that the existing execution result behavior remains covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100