Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Blockhound is used with EmbeddedKafka for unit test, kafka wont terminate #170

Open
legendjaks opened this issue Feb 16, 2021 · 1 comment
Labels
for/user-attention This issue needs user attention (feedback, rework, etc...)

Comments

@legendjaks
Copy link

legendjaks commented Feb 16, 2021

When Blockhound is used with EmbeddedKafka for unit test, Kafka won't terminate after the test is completed. If Blockhound is disabled, no problem in running tests.

Expected Behavior

After tests are completed, embedded Kafka should be terminated.

Actual Behavior

After tests are completed, embedded Kafka is not terminated. So other tests are not running and the system is waiting for Kafka to stop.

Steps to Reproduce

@SpringBootTest(classes = {KafkaConfiguration.class})
@EmbeddedKafka(partitions = 1, brokerProperties = {TestConstants.SERVER, TestConstants.PORT})
@DirtiesContext
@Slf4j
class OrderUpdateTest {

  @BeforeEach
  public void init() {
    BlockHound.install();
    log.info("Installed blockhound");
  }

  @Test
  public void testProducer()
    throws Exception {
     log.info("test");
  }

  @AfterEach
  public void after() {
    log.info("finished test");
  }
}

Your Environment

  • OS: macOS Big Sur
  • Java:JDK11
  • Spring Boot 2.4.2
  • Blockhound 1.0.4.RELEASE
  • Spring Kafka 2.5.6.RELEASE
@pderop
Copy link
Contributor

pderop commented Jan 25, 2023

let's see if we can close this old issue ...

So, I have difficulties to reproduce this issue;
I'm using this project which is similar to your use case.
I have modified the pom.xml in order to add a dependency on bockhound 1.0.6.RELEASE, then I changed the SpringBootEmbeddedKafka class in order to install BlockHound from SpringBootEmbeddedKafka.setUpClass() method.
and using JDK 11, it seems to work well for me.

if you still want this issue to be investigated, please try to update the above sample code, and try to reproduce.

thanks.

@pderop pderop added the for/user-attention This issue needs user attention (feedback, rework, etc...) label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for/user-attention This issue needs user attention (feedback, rework, etc...)
Projects
None yet
Development

No branches or pull requests

2 participants