Skip to content

feat: allow reusing the reaper #3051

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jcmfernandes
Copy link

@jcmfernandes jcmfernandes commented Mar 22, 2025

What does this PR do?

  1. Makes the session ID configurable, allowing for long-running sessions (the key change).
  2. Deletes config.go since everything inside was deprecated.
  3. Simplifies how unique session IDs are generated.

Regarding point 3, I must admit that I don't understand the advantages of the hashing logic I ended up deleting. I'm happy to revert it, though.

Why is it important?

Speaking of my use-case, Apache Pulsar takes a long time to boot, so I wanted testcontainers to bring it up, eventually take it down, but allow me to use the same container across several runs. This wasn't the case, since I was getting a new reaper running on every test run. I wanted a rolling-window behavior, hence this change.

Related issues

Follow-ups

Update the documentation.

This allows for long-running sessions - e.g., across multiple runs - to
reuse the reaper.
Copy link

netlify bot commented Mar 22, 2025

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 3bb3919
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/67debb353b655c00087a2634
😎 Deploy Preview https://deploy-preview-3051--testcontainers-go.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.

@jcmfernandes jcmfernandes changed the title Reuse reaper feat: allow reusing the reaper Mar 22, 2025
@jcmfernandes jcmfernandes marked this pull request as ready for review March 22, 2025 13:39
@jcmfernandes jcmfernandes requested a review from a team as a code owner March 22, 2025 13:39
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.

[Feature]: Support a reuseWindow for cleaning up reusable containers if no tests run within a certain duration
1 participant