-
-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: create container: port not found: creating reaper failed #2798
Comments
go.mod
|
There are know race conditions in the reaper which should be fixed once we've merged #2728 and updated to use the new reaper image container the work which was merged today testcontainers/moby-ryuk#141 |
@mukulmantosh did you find any workaround for this issue? |
If you use the branch from #2728 does it fix your issue? |
On the merged commit, we now instead get
|
Can you confirm you're using v0.34.0 and the exact test case you're using? |
I've tried with the following and all works as expected, so suspecting it could be something setup releated package testcontainers_test
import (
"context"
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/modules/postgres"
"github.com/testcontainers/testcontainers-go/wait"
)
func TestReaper(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
defer cancel()
dbName, dbUsername, dbPassword := "test_db", "test_user", "test_password"
pgContainer, err := postgres.Run(ctx, "docker.io/postgres:16-alpine",
postgres.WithDatabase(dbName),
postgres.WithUsername(dbUsername),
postgres.WithPassword(dbPassword),
testcontainers.WithWaitStrategy(
wait.ForLog("database system is ready to accept connections").
WithOccurrence(2).WithStartupTimeout(10*time.Second),
),
)
testcontainers.CleanupContainer(t, pgContainer)
require.NoError(t, err)
dbHost, err := pgContainer.Host(ctx)
require.NoError(t, err)
require.NotEmpty(t, dbHost)
mappedPort, err := pgContainer.MappedPort(ctx, "5432/tcp")
require.NoError(t, err)
require.NotEmpty(t, mappedPort)
} go.mod:
|
We later tried |
We saw recently the same on github actions more and more common for this issues. |
Testcontainers version
0.33.0
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host arch
x86
Go version
1.23
Docker version
Client: Version: 27.2.0 API version: 1.47 Go version: go1.21.13 Git commit: 3ab4256 Built: Tue Aug 27 14:17:17 2024 OS/Arch: windows/amd64 Context: desktop-linux Server: Docker Desktop 4.34.2 (167172) Engine: Version: 27.2.0 API version: 1.47 (minimum version 1.24) Go version: go1.21.13 Git commit: 3ab5c7d Built: Tue Aug 27 14:15:15 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.7.20 GitCommit: 8fc6bcff51318944179630522a095cc9dbf9f353 runc: Version: 1.1.13 GitCommit: v1.1.13-0-g58aa920 docker-init: Version: 0.19.0 GitCommit: de40ad0
Docker info
What happened?
I attempted to run tests that involve both Postgres and NATS. While they often run smoothly on their own, there are times when they fail unexpectedly.
I am not using the GenericContainer, instead using the official supported ones.
Example: Postgres
NATS
Relevant log output
Additional information
No response
The text was updated successfully, but these errors were encountered: