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
Tests Fail with Timeout - System.Net.Sockets.SocketException (61): Connection refused #106
Comments
Hi, is there any progress on this? We are facing the same issue. |
Nope, I do not have any spare private time to fix this on my own. But I'm hoping that somebody from the community will fix this and send a PR. Please ask your manager to invest some time into this! 😉👍 |
The using variant failed for us in our ci/cd pipeline as well. So we went with the random Port & deprecated API. Start Mongo Runner with Own PortPool
Maybe that helps. Can't find time to implement a clean PR too :/ |
I have the same issue and exact same error since moving to net5 and Mongo2Go 3.0. I have tried the above workaround(s) but it hasn't worked for me :( or at least not on our build machine (Jenkins pipeline). |
this is very much related to #116 and #115 as discovered by @realLiangshiwei. In my initial implementation I used a simple lock and incremented the ports. But rider and friends can set the number of assemblies in parallel, when multiple processes get available ports, mong2go returns duplicate ports and throw an exception. PR #116 should fix this. Please report any ongoing issues if 3.1.1 does not resolve your problem. I'm closing this issue for now. |
Hi,
we noticed our builds to fail from time to time due to timeout exception on our GitLab runners.
The weird thing is that we do not see any correlation to specific runners or servers causing problems but the same runner would succeed three times and the next time it fails.
I was trying to reproduce this error on my machine (macbook) and found that the tests always succeed when running from my IDE (Rider) but they will fail if I run "dotnet test" from the console.
We found that our tests have a significant overhead if we create a runner for every test as recommended by the docs.
So for our case a Fixture worked great in terms of Unit Test speed but is now causing the trouble if multiple test projects contain the fixture.
The issue we run into is the following and we see this pattern for every failing test. The address in use won't show up in the successful runs.
For me it looks like the check "is the port is already in use" fails if multiple projects contains the fixture. Not sure why (maybe the dispose pattern is implemented wrong?).
I tried to fix the issue and following things kinda "worked"
So I am wondering if the "IsPortAvailable" check is working correctly and we run into a timing issue. Do both tests start at the exact same time and try to access the same port?
It would help us to fix the issue if we could decide which Port the runner tries to use, maybe allowing to set the "_startPort" or even pass a custom IPortPool implementation. A "start to probe at random Port" option would do it too.
Edit we use the latest version 2.2.14 with dotnet core 5.0. We saw the same problem on dotnet core 3.1 as well.
The text was updated successfully, but these errors were encountered: