vitalijr2 / ijhttp-tools

Maven plugin, Spring Boot Test autoconfiguration and jUnit Extension for IntelliJ HTTP Client
Apache License 2.0
3 stars 0 forks source link

maven plugin - Zombie docker containers on failured #47

Open GoncaloPT opened 3 months ago

GoncaloPT commented 3 months ago

Summary

ijhttp maven plugin doesn't fail gracefully when a test failure occurs

What is the current bug behavior?

REPRODUCER

This reproducer wants to showcase that the ijhttp plugin doesn't fail gracefully when a failure occurs.

It consists of a simple test that tries to do a GET request to a non-existing URL. This can be seen on src/test/http/this-will-fail.http.

ijhttp is configured to run such test.

The test uses testcontainers: http mockserver and redpanda ( kafka ) to simulate a real environment.

Observed behavior

On test failure, post-integration-phase is not executed. This results in docker containers not being stopped, and ports not being released.

Steps to reproduce

Steps to reproduce

  1. Run the following command:
mvn clean integration-test

To confirm the faulty behaviour, check if at least one of the commands has output, if so then there are "leftovers" caused by spring not being properly stopped.

lsof -t -i tcp:9001
docker ps

What is the expected correct behavior?

Expected behavior

Although the test is expected to fail, the plugin should fail gracefully. The post-integration-phase should be executed, result in spring boot stop command to be executed. This would allow docker containers to stop, and ports to be released properly.

Additional context

The above can be found on readme of https://github.com/GoncaloPT/ijhttp-not-stoping

Possible fixes

No response

GoncaloPT commented 3 months ago

@vitalijr2 I'm available to try to find a fix if you find this to be a actual bug.