Skip to content
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

Container stuck when calling start #30

Open
ruiarodrigues opened this issue Nov 25, 2023 · 1 comment
Open

Container stuck when calling start #30

ruiarodrigues opened this issue Nov 25, 2023 · 1 comment

Comments

@ruiarodrigues
Copy link

ruiarodrigues commented Nov 25, 2023

Hi!

I'm trying to use the testcontainers for Ruby to use a minIO image in my rspec. I tried multiple ways but didn't succeed. The container keeps being stuck forever when calling start. I thought it was the way I passed the arguments to the container but I think it's not.
So I tried to use one of the example with memcached

    puts 'Starting'
    memcached = Testcontainers::GenericContainer.new("memcached:latest").with_exposed_port(11211).start
    puts 'Started'

And the 'Started' log is never written.
I can see that the image has been downloaded by the test container but then nothing. It get stuck.

REPOSITORY              TAG                            IMAGE ID       CREATED         SIZE
localstack/localstack   3.0                            8c92f9339e48   9 days ago      1.17GB
minio/minio             RELEASE.2023-10-25T06-33-25Z   7c07ce16e586   4 weeks ago     289MB
memcached               latest                         f05ec0c73b4a   5 weeks ago     126MB
minio/minio             RELEASE.2023-09-04T19-57-37Z   9701b708d3cb   2 months ago    292MB
alpine                  3.16                           47a0d92d42c9   3 months ago    5.3MB
adobe/s3mock            2.17.0                         871cb24de6e3   4 months ago    98MB
testcontainers/ryuk     0.5.1                          8be3fdcaa3e8   6 months ago    12.2MB
confluentinc/cp-kafka   7.2.2                          93fe61e45a92   14 months ago   846MB
testcontainers/ryuk     0.3.4                          5d28cedc492d   16 months ago   11.5MB

I'm using the minIO testcontainer for java in JUnit tests and it works fine. So the docker part is working fine in my laptop.

But when using with RSpec it doesn't work. I'm using it like this (and tried many different ways using with_xxx):

@container = Testcontainers::DockerContainer.new(image: "minio/minio:RELEASE.2023-10-25T06-33-25Z",
                                                     port_bindings: 9000,
                                                     command: %w[server /data]
                                                     )
    @container.add_wait_for(:logs, /1 Online, 0 Offline/)
    @container.start

How can I understand what's going on?
Can 'start' be called anywhere in the RSpec?

@guilleiguaran
Copy link
Member

@ruiarodrigues thanks for reporting this, I'll investigate it during the next days and hopefully return with some answers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants