-
Notifications
You must be signed in to change notification settings - Fork 41.3k
Description
Hey, I'd really like to get some help.
TL;DR : MessageListenerContainers
which were created in the previous contexts are still listening, grinding the tests to a halt.
// Major libraries
Spring Boot 2.5.4
maven.compiler.target 11
spring-cloud 2020.0.3
ibmmq 2.5.0
testcontainer-junit 1.15.3
testcontainer-kafka 1.15.3
Setup
@KafkaListener
and @JmsListener
; @Testcontainers
on abstract @SpringBootTest
with @DynamicProperty
used to load data from @Containers
What can be seen
MessageListenerContainers
created with the data loaded in @DynamicProperty
are persisted between runs - before contexts loads (With/without @DirtiesContext
) I can see that both KafkaListeners and JMSListeners are trying to connect to their respective servers with the ports from the "previous (docker) container" - previous @DynamicContext
, and by consequence prevous context
Additionally, MessageListenerContainer from Kafka and JMS are not related, except they share only one interface worth mentioning, SmartLifecycle
What I suspect
SmartLifecycle
is not destroyed/stopped on context refresh.
Please help? :)