testcontainers-rs icon indicating copy to clipboard operation
testcontainers-rs copied to clipboard

fix: reuse container requires name

Open tisonkun opened this issue 2 weeks ago • 7 comments

... also sync Container should reuse ContainerAsync's drop impl.

This resolves https://github.com/testcontainers/testcontainers-rs/issues/742.

cc @DDtKey @the-wondersmith

tisonkun avatar Dec 01 '25 05:12 tisonkun

Deploy Preview for testcontainers-rust ready!

Name Link
Latest commit 499d5c61e67cfcc337e24941c9797c94666f16e0
Latest deploy log https://app.netlify.com/projects/testcontainers-rust/deploys/692d43a922732600080d6777
Deploy Preview https://deploy-preview-887--testcontainers-rust.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.

netlify[bot] avatar Dec 01 '25 05:12 netlify[bot]

Let me fix the format issue.

... also it seems that tests rely on selecting by labels without container name, let me try to fine tune the impl.

tisonkun avatar Dec 01 '25 07:12 tisonkun

@DDtKey failure resolved. Please help in triggering the CI.

tisonkun avatar Dec 01 '25 07:12 tisonkun

Besides, we may later drop the "reusable-containers" flag and just deliver it by default. There is no extra dependency requirement.

tisonkun avatar Dec 01 '25 07:12 tisonkun

@tisonkun I need to dig in to confirm when I get back to my desk, but I think there's some overlap here with the fix branch I'd previously asked you to test. Come to think of it actually, I need to actually get that branch up to date with main 🤔😅.

tl;dr I'll block some time out today to give this PR a closer look, and some time this week to get that branch fixed up and get a proper PR opened.

the-wondersmith avatar Dec 02 '25 18:12 the-wondersmith

@the-wondersmith 👍🏻

I think this PR can resolve my remaining issue now. If @DDtKey or other maintainer can get it reveiwed, you may put your changes upon this one.

That said, I'm glad to learn any concrete suggestion to improve the patch in place. And there is still a pending issue (https://github.com/testcontainers/testcontainers-rs/pull/887#discussion_r2575699650) we need to decide before testcontainers-rs can go back to my testkit ><

tisonkun avatar Dec 03 '25 01:12 tisonkun

Reminder @DDtKey maybe retrigger the CI workflow?

tisonkun avatar Dec 08 '25 05:12 tisonkun

Sorry for the delay with review @tisonkun! That looks like a valid fix regardless of reuse container functionality and helps to reuse the code

DDtKey avatar Dec 19 '25 00:12 DDtKey

Great! Thanks for your reviewing.

tisonkun avatar Dec 19 '25 01:12 tisonkun