diff --git a/docker_auth_test.go b/docker_auth_test.go index d494d6d12e..b8580a08ea 100644 --- a/docker_auth_test.go +++ b/docker_auth_test.go @@ -286,7 +286,7 @@ func prepareLocalRegistryWithAuth(t *testing.T) string { ContainerFilePath: "/data", }, }, - WaitingFor: wait.ForExposedPort(), + WaitingFor: wait.ForHTTP("/").WithPort("5000/tcp"), } // } @@ -311,9 +311,6 @@ func prepareLocalRegistryWithAuth(t *testing.T) string { removeImageFromLocalCache(t, addr+"/redis:5.0-alpine") }) - _, cancel := context.WithCancel(context.Background()) - t.Cleanup(cancel) - return addr } diff --git a/modules/registry/registry.go b/modules/registry/registry.go index 6cfa3d537b..22aa86be54 100644 --- a/modules/registry/registry.go +++ b/modules/registry/registry.go @@ -220,10 +220,9 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom // convenient for testing "REGISTRY_STORAGE_DELETE_ENABLED": "true", }, - WaitingFor: wait.ForAll( - wait.ForExposedPort(), - wait.ForLog("listening on [::]:5000").WithStartupTimeout(10*time.Second), - ), + WaitingFor: wait.ForHTTP("/"). + WithPort(registryPort). + WithStartupTimeout(10 * time.Second), } genericContainerReq := testcontainers.GenericContainerRequest{