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

Use a lookup key based on the container request to find containers to be reused

Open mdelapenya opened this issue 3 years ago • 0 comments

    > The fix makes sense from a technical perspective. However, regarding the `reuse` behavior itself, we decided in `testcontainers-java` that relying on the container name is not a stable indicator of equality(with the name itself potentially leading to conflicts) and we, therefore, use the hash of the container create command as the lookup key.

@kiview what do you think if we proceed with the merge, and create a discussion/issue to refactor how the reuse container feature works: if I understood correctly, a container should be reused if and only if the container request (Go abstraction) is exactly the same, identified by a unique hash of the struct representing the request.

Originally posted by @mdelapenya in https://github.com/testcontainers/testcontainers-go/issues/558#issuecomment-1278768453

mdelapenya avatar Oct 14 '22 16:10 mdelapenya