-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Hello!
The case is following:
- testcontainers-java 1.14.3
- docker-compose.yml with services A, B, C
- B depends on A
- C depends on B and A
- withLocalCompose(true)
A starts quite quickly, B start takes ~40 seconds
While B is unavailable C keeps restarting
- Tried Wait.forLogMessage() for A - works
- Tried Wait.forLogMessage() for B - works
- Tried Wait.forLogMessage() for C -
Timed out waiting for log output matching <log> - Tried Wait.forLogMessage() for both B and C -
Timed out waiting for log output matching <log>
Actually I'm interested in waiting for both of the services B and C explicitly, but only C should be valid as well.
Tried all the possible regex stuff (.*log.*, .*log.*\\s, .*log!\\s, .*log.*\n.* etc)
From my impression it seems that log polling breaks for a restarting container.
The difference between B and C here is that when starting B does not encounter broken B->A interaction since A could easily be started for the time of starting B. Hence B does not get restarted 'on error'.
As I got from debugging
testcontainers-java/core/src/main/java/org/testcontainers/containers/output/WaitingConsumer.java
Line 85 in 816b8c3
| OutputFrame frame = frames.pollLast(100, TimeUnit.MILLISECONDS); |
becomes
null when the container is going to start successfully, it's really strange. It contains lines from a stacktrace when the container is going to be restarted and null when it's running Any ideas? Thanks.
p.s. of course I see the desired log of the C in my terminal using docker logs C