Skip to content

Conversation

@zYasser
Copy link

@zYasser zYasser commented Aug 15, 2025

Hi,
This first open source contribution, let's talk about this feature:
This feature lets users shut down all test containers with a single command, making it convenient to clean up after reusing containers across tests, especially once all test suites have finished running.

@netlify
Copy link

netlify bot commented Aug 15, 2025

Deploy Preview for testcontainers-node ready!

Name Link
🔨 Latest commit 8f379fe
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-node/deploys/689f1c6f91ed6f00080f4ddf
😎 Deploy Preview https://deploy-preview-1109--testcontainers-node.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 project configuration.

@kiview
Copy link
Member

kiview commented Aug 15, 2025

Hi @zYasser, thanks for your first OSS contribution 🙌

Given you are saying:

making it convenient to clean up after reusing containers across tests, especially once all test suites have finished running.

That's what Ryuk is already for, since it will remove all resources once the Testcontainers process ends. Do you really need to have a manual mechanism to clean this up?
And in case we do, also in that case Ryuk can be used instead of creating new concepts within the code base.

@zYasser
Copy link
Author

zYasser commented Aug 15, 2025

That's what Ryuk is already for, since it will remove all resources once the Testcontainers process ends. Do you really need to have a manual mechanism to clean this up?

sorry, i didn't know about this for some reason when i create a new container with .withReuse() after all the test is complete for some reason the containers is still alive

@zYasser zYasser closed this Aug 15, 2025
@kiview
Copy link
Member

kiview commented Aug 15, 2025

Yes, that is the purpose of withReuse, to have containers survive the process lifetime.
In Java, we use the container singleton pattern to share containers across test classes (which will still respect Ryuk for overall cleanup), not sure how this pattern can be best implemented in Node.js.

I am sure @cristianrgreco can help (we should probably also add this to the docs, if we have something similar in Node.js).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants