You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test failing with failed to create container: connecting to reaper failed: Connecting to Ryuk on localhost:32787 failed: dial tcp [::1]:32787: connect: connection refused
I noticed the failing test(s) always ran after one other specific test (which succeeded). The only difference was this test wasn't using a TestContainer.
Diving deeper, I noticed the reaper container is normally reused once initialized;
// If reaper already exists re-use it
if reaper != nil {
return reaper, nil
}
Several integration tests run, creating their own container but reusing the Ryuk reaper container (as they are running in close succession, within the 10s timeout)
The integration test without test-container runs. This one takes about 20-30 sec, so the reaper container shuts down
The next integration test tries to create a container again, but aborts as it fails to connect to the 'existing' reaper container.
The code should detect whether the Ryuk container is actually still running, and if not running create a new one instead of trying to reuse the non-existing one.
Relevant log output
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
Hi @mdonkers thanks for opening this issue, which I think it's related to #258. In there, the code initialises the singleton properly. I'm going to prioritise that PR in order to fix the reaper initialisation. Besides that, I think checking if Ryuk container is present could be part of the checks. Do you feel comfortable sending a PR for that?
Hi @mdelapenya ,
It's indeed somewhat related. However in my case the initial initialisation succeeded, but the container was still invalid later on.
I can try creating a PR this week, including #258. Will link it here once I have something.
Testcontainers version
0.15.0
Using the latest Testcontainers version?
Yes
Host OS
Linux
Host arch
x86
Go version
1.19
Docker version
$ docker version Client: Docker Engine - Community Version: 23.0.0-rc.1 API version: 1.42 Go version: go1.19.4 Git commit: 139e924 Built: Thu Dec 22 23:37:13 2022 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 23.0.0-rc.1 API version: 1.42 (minimum version 1.12) Go version: go1.19.4 Git commit: cba986b Built: Thu Dec 22 23:37:13 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.14 GitCommit: 9ba4b250366a5ddde94bb7c9d1def331423aa323 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0
Docker info
What happened?
Test failing with
failed to create container: connecting to reaper failed: Connecting to Ryuk on localhost:32787 failed: dial tcp [::1]:32787: connect: connection refused
I noticed the failing test(s) always ran after one other specific test (which succeeded). The only difference was this test wasn't using a TestContainer.
Diving deeper, I noticed the
reaper
container is normally reused once initialized;testcontainers-go/reaper.go
Line 52 in 126aeb9
This happened for my failing test as well. But trying to connect to the
reaper
, this failed;testcontainers-go/reaper.go
Line 127 in 126aeb9
When the
moby-ryuk
runs, it only stays 'active' for as long as it has some active connection. After all connections are lost, it shuts down after a pre-determined timeout of 10 seconds, which cannot be configured:https://github.com/testcontainers/moby-ryuk/blob/8f512d37699cb6e5a3b28f2433c2b3b894a78e5d/main.go#L152
So what happens in my situation;
The code should detect whether the Ryuk container is actually still running, and if not running create a new one instead of trying to reuse the non-existing one.
Relevant log output
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: