localstack / localstack-java-utils

☕ Java utilities and JUnit integration for LocalStack
Apache License 2.0
75 stars 43 forks source link

When not using elasticsearch, the port is still binded during unit test #55

Open feguiguren opened 3 years ago

feguiguren commented 3 years ago

In my test, I only use S3 service, with this annotation:

@ExtendWith(LocalstackDockerExtension.class) @LocalstackDockerProperties( portEdge = "4577", services = {"s3"}, hostNameResolver = HostResolver.class)

I configured the edge port because I have multiple tests running on the same runner at the same time, but they fail because the elasticsearch port is already binded by another test suite.

[error] docker: Error response from daemon: driver failed programming external connectivity on endpoint hopeful_fermi (a98226257cb706ef22f296a7cb04d3b0ce148d1f013f251f57dd38a9c2cfe668): Bind for 0.0.0.0:4571 failed: port is already allocated.

If I am not using elastic search, I think the port should not be in use.

whummer commented 3 years ago

Thanks much for this suggestion @feguiguren - makes perfect sense. Please note that this repo is more community-driven, and less actively maintained by the LocalStack core maintainers. Do you think you'd be able to create a pull request for this fix? Thanks for your help!

lakkeger commented 1 year ago

Hi! We just wanted to follow up on our last message to see whether your issue has been resolved. Were you able to get it working with the latest version of LocalStack? We would appreciate your feedback!