testcontainers / testcontainers-dotnet

A library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.
https://dotnet.testcontainers.org
MIT License
3.82k stars 279 forks source link

feat: Use `exec` to replace current shell with the Kafka process (as ENTRYPOINT) #1282

Closed jasoncouture closed 1 month ago

jasoncouture commented 1 month ago

Without this, signals (including SIGTERM/SIGINT) are sent to the script instead of the kafka process, delaying container shutdown until docker times out and sends SIGKILL

What does this PR do?

Launch apache kafka using exec to pass signals to the kafka process, for faster shutdown.

Why is it important?

Tests take 30 seconds when shutting down kafka containers, because the kafka process does not receive SIGTERM and must wait for docker to send SIGKILL after the timeout period

How to test this PR

Run test container before this change, and observe the time taken to shut down. Run the same container with this change, and observe the same, but without the delay.

netlify[bot] commented 1 month ago

Deploy Preview for testcontainers-dotnet ready!

Name Link
Latest commit e53d04f35fd87f7b598117724ad7f317f1a333a6
Latest deploy log https://app.netlify.com/sites/testcontainers-dotnet/deploys/671160d1c0aed80008472e69
Deploy Preview https://deploy-preview-1282--testcontainers-dotnet.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.