testcontainers / testcontainers/testcontainers-go

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

Open
#568 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

chore
Dominant language
Go
Stars
5k
Forks
637
Avg merge
2d 12h
Merged PRs (30d)
26

Description

    > 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin by locating the existing container-reuse lookup and the Go container-request abstraction; no file or test is named in the issue. Done means reuse occurs only when the complete container request matches via a stable unique hash, rather than the container name.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
devops, testing
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.