-
Notifications
You must be signed in to change notification settings - Fork 73
Closed
Labels
Description
I got a test case that works well on Windows, and with Mono on Linux, but it fails with Mono on MacOSX.
Test framework used is Nunit
[Test]
public async Task TestMongo2Go()
{
var tmpDir = System.IO.Path.GetTempPath();
MongoDbRunner _mongodb = MongoDbRunner.Start(tmpDir);
var _mongoClient = new MongoClient(_mongodb.ConnectionString);
IMongoDatabase db = _mongoClient.GetDatabase("unittest");
var role = new Role { Name = "ALL PERMISSIONS", PermissionTypes = new List<string> { "ALL PERMISSIONS", "READ_ALL" } };
await db.GetCollection<Role>("role").InsertOneAsync(role);
var user = new User { Name = "unittest", PersonalNumber = "123", RoleIds = new List<ObjectId> { role.Id } };
await db.GetCollection<User>("user").InsertOneAsync(user);
var users = await db.GetCollection<User>("user").Find(u => true).ToListAsync();
Assert.AreEqual(1, users.Count);
}
Stack trace is:
TestMono.TestMongo2GoUser
System.TimeoutException : A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "8", ConnectionMode : "Automatic", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 8, EndPoint : "Unspecified/localhost:27024" }", EndPoint: "Unspecified/localhost:27024", State: "Disconnected", Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> System.Net.Sockets.SocketException: Connection refused
No firewall and ping localhost works
Any suggestions would be appreciated