-
-
Notifications
You must be signed in to change notification settings - Fork 68
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: Container creation stuck when creating mongo with entrypoint #1088
Comments
Hi @zahidcakici, I suggest using In addition to debugging hints, I don't think setting up a replica set that way is something gnomock is built to do. Replica set means a number of containers speaking one to another, but gnomock starts individual containers and assigns host ip to every one of them randomly. To have a replica set, you would need to create containers serially one after the other, and provide the address of the previous one to the next one, using host ip. This sounds like a networking hell to me. |
I get this error constantly:
Yeah I don't want to deal with that networking hell neither however I want to use transactions and mongodb supports transaction only in replica sets or clusters unfortunately. So replicaset with just one db instance is sufficient to me. I can do that on my local with some configurations and wanted to do it also for tests.
The first container is set up by I can connect db container and run some commands but container should be initialized with |
I see that you already are using a custom entrypoint, so the only other thing that I think can cause this, is invalid mongo client setup, which should be created with Even if you use a proper client internally in your code, Gnomock creates its own client to perform healthcheck and mark the container as ready to use. I suggest you try overwriting the default preset healthcheck function using If while debugging you discover a need to run extra operations on the container before it is marked as ready, we can discuss adding the missing features, such as command execution and all that, but I hope this won't be needed. |
Describe the bug
I am trying to create a gnomock container with mongo preset with replica set using
WithEntrypoint()
method. When I debug the code it creates container as expected however it gets stuck on code-side.To Reproduce
Expected behavior
I expect it to create the container and continue.
System (please complete the following information):
Additional context
Is there a more effective method using Gnomock to make a replica set other then creating it like this and then running a replicaset init command? Please feel free to recommend one.
The text was updated successfully, but these errors were encountered: