asimmon / ephemeral-mongo

EphemeralMongo is a set of three NuGet packages wrapping the binaries of MongoDB 4, 5 and 6 built for .NET Standard 2.0.
Apache License 2.0
103 stars 12 forks source link

ubuntu-24.04: cannot start the database (EphemeralMongo7 1.1.3) #57

Open marco-merola-ef opened 3 weeks ago

marco-merola-ef commented 3 weeks ago

Hi, I am getting this error when trying to start the MongoRunner on a github job runner with ubuntu-24.04

Error Message: System.TimeoutException : MongoDB connection availability took longer than the specified timeout of 30 seconds. Consider increasing the value of 'ConnectionTimeout'. Stack Trace: at EphemeralMongo.MongodProcess.StartAndWaitForConnectionReadiness() at EphemeralMongo.MongodProcess.Start() at EphemeralMongo.MongoRunner.RunInternal() at EphemeralMongo.MongoRunner.Run(MongoRunnerOptions options)

Any suggestions?

mdhom commented 2 weeks ago

Do you get this error on every run, or only on the second run? If so, can you manuall kill the currently running mongod process and try again? That helps me, see #58.

wouterSeyen commented 2 weeks ago

I'm experiencing the same issue. We have a dotnet solution with several xUnit test projects performing tests using EphemeralMongo.

I use following command to run my tests: dotnet test MySolution.sln

Locally (on Macbook Pro with M2 chip), this works without any issues.

However, in a docker build using mcr.microsoft.com/dotnet/sdk:8.0 as base image, this results in the same error as described in bug description.

marco-merola-ef commented 2 weeks ago

@wouterSeyen I managed to solve it by using dotnet test container for mongo: https://dotnet.testcontainers.org/modules/mongodb/