testcontainers / testcontainers-node

Testcontainers is a NodeJS library that supports tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
https://testcontainers.com
MIT License
1.94k stars 195 forks source link

The exec call hangs #868

Open polRk opened 1 week ago

polRk commented 1 week ago

Expected Behaviour Immediately return result like docker exec containerId

Actual Behaviour It gets stuck

Testcontainer Logs

  testcontainers [INFO] [52c1ac77bd17] Container is ready +0ms
  testcontainers [DEBUG] [52c1ac77bd17] Getting container by ID... +1ms
  testcontainers [DEBUG] [52c1ac77bd17] Got container by ID +0ms
  testcontainers [DEBUG] [52c1ac77bd17] Execing container with command "/opt/ydb/bin/ydbd -s grpc://127.0.0.1:2135 admin blobstorage config init --yaml-file /opt/ydb/cfg/config.yaml"... +0ms

Steps to Reproduce This promise will never come to an end

Image

Environment Information

cristianrgreco commented 6 days ago

The command that's hanging is "/opt/ydb/bin/ydbd -s grpc://127.0.0.1:2135 admin blobstorage config init --yaml-file /opt/ydb/cfg/config.yaml". Do you think the command itself could be hanging instead of Testcontainers?

I would try with a simple command like docker.exec("echo hello world");, and if that doesn't hang, look into why the ydbd command is hanging.

polRk commented 4 days ago

look into why the ydbd command is hanging.

No, this is not the case, if you run the command directly through docker exec, they do not hang and are executed instantly