Fix race condition when looking up reaper (ryuk) container by emetsger · Pull Request #2508 · testcontainers/testcontainers-go
This was referenced
Apr 22, 2024
emetsger
changed the title
Use health status when looking up reaper (ryuk) container
Fix race condition when looking up reaper (ryuk) container
… being started by newReaper in a separate process. A race between newReaper and lookUpReaperContainer occurs: - newReaper creates the container with a ContainerRequest.WaitingFor = wait.ForListeningPort(listeningPort) - newReaper starts the container - lookUpReaperContainer obtains the container and returns. - newReaper invokes the readiness hook wait.ForListeningPort(listeningPort).
mdelapenya added a commit that referenced this pull request
Jun 10, 2024* If the ryuk container has a health status, wait for a healthy container before returning. * Use docker/types for health status, but also check for the zero value. * Wait for the ryuk port to be available in case the container is still being started by newReaper in a separate process. A race between newReaper and lookUpReaperContainer occurs: - newReaper creates the container with a ContainerRequest.WaitingFor = wait.ForListeningPort(listeningPort) - newReaper starts the container - lookUpReaperContainer obtains the container and returns. - newReaper invokes the readiness hook wait.ForListeningPort(listeningPort). * Fix whitespace. * chore: simplify * chore: make lint * chore: change emoji in log output when waiting * chore: move inside reuseReaper --------- Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit to bearrito/testcontainers-go that referenced this pull request
Jun 11, 2024mdelapenya added a commit that referenced this pull request
Jun 18, 2024* If the ryuk container has a health status, wait for a healthy container before returning. * Use docker/types for health status, but also check for the zero value. * Wait for the ryuk port to be available in case the container is still being started by newReaper in a separate process. A race between newReaper and lookUpReaperContainer occurs: - newReaper creates the container with a ContainerRequest.WaitingFor = wait.ForListeningPort(listeningPort) - newReaper starts the container - lookUpReaperContainer obtains the container and returns. - newReaper invokes the readiness hook wait.ForListeningPort(listeningPort). * Fix whitespace. * chore: simplify * chore: make lint * chore: change emoji in log output when waiting * chore: move inside reuseReaper --------- Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
mdelapenya added a commit to mdelapenya/testcontainers-go that referenced this pull request
Jun 24, 2024This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters