Mongo2Go: Can't run Mongo2Go on VSTS / Azure Devops
Currently, I’m working with Mongo2Go for unit test. But when I build my Project on VSTS and see it doesn’t work properly. You can check the following error
2018-08-09T09:06:03.9933372Z [xUnit.net 00:00:40.97] xxxxxxx.BackEnd.Tests.Project.ProjectReadServiceTests.TestGetProjectDetailAsync [FAIL]
2018-08-09T09:06:04.0574498Z Failed xxxxxxx.BackEnd.Tests.Project.ProjectReadServiceTests.TestGetProjectDetailAsync
2018-08-09T09:06:04.0574987Z Error Message:
2018-08-09T09:06:04.0575333Z System.AggregateException : One or more errors occurred. (A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "2", ConnectionMode : "Automatic", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 2, EndPoint : "127.0.0.1:27019" }", EndPoint: "127.0.0.1:27019", State: "Disconnected", Type: "Unknown" }] }.)
2018-08-09T09:06:04.0575882Z ---- System.TimeoutException : A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "2", ConnectionMode : "Automatic", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 2, EndPoint : "127.0.0.1:27019" }", EndPoint: "127.0.0.1:27019", State: "Disconnected", Type: "Unknown" }] }.
2018-08-09T09:06:04.0576249Z Stack Trace:
2018-08-09T09:06:04.0576430Z at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
2018-08-09T09:06:04.0576638Z at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
2018-08-09T09:06:04.0576802Z at System.Threading.Tasks.Task.Wait()
2018-08-09T09:06:04.0577004Z at xxxxxxx.BackEnd.Tests.Project.ProjectReadServiceTests.TestGetProjectDetailAsync() in D:\a\1\s\Tests\xxxxxxx.BackEnd.Tests\Project\ProjectReadServiceTests.cs:line 116
2018-08-09T09:06:04.0577230Z ----- Inner Stack Trace -----
2018-08-09T09:06:04.0577420Z at MongoDB.Driver.Core.Clusters.Cluster.ThrowTimeoutException(IServerSelector selector, ClusterDescription description)
2018-08-09T09:06:04.0577636Z at MongoDB.Driver.Core.Clusters.Cluster.WaitForDescriptionChangedHelper.HandleCompletedTask(Task completedTask)
2018-08-09T09:06:04.0577823Z at MongoDB.Driver.Core.Clusters.Cluster.<WaitForDescriptionChangedAsync>d__50.MoveNext()
2018-08-09T09:06:04.0578017Z --- End of stack trace from previous location where exception was thrown ---
2018-08-09T09:06:04.0578597Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-08-09T09:06:04.0578857Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2018-08-09T09:06:04.0579088Z at MongoDB.Driver.Core.Clusters.Cluster.<SelectServerAsync>d__43.MoveNext()
2018-08-09T09:06:04.0579303Z --- End of stack trace from previous location where exception was thrown ---
2018-08-09T09:06:04.0579791Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-08-09T09:06:04.0580027Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2018-08-09T09:06:04.0580245Z at MongoDB.Driver.MongoClient.<AreSessionsSupportedAfterSeverSelctionAsync>d__37.MoveNext()
2018-08-09T09:06:04.0580455Z --- End of stack trace from previous location where exception was thrown ---
2018-08-09T09:06:04.0580694Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-08-09T09:06:04.0580901Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2018-08-09T09:06:04.0581107Z at MongoDB.Driver.MongoClient.<AreSessionsSupportedAsync>d__34.MoveNext()
2018-08-09T09:06:04.0581326Z --- End of stack trace from previous location where exception was thrown ---
2018-08-09T09:06:04.0581817Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-08-09T09:06:04.0582028Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2018-08-09T09:06:04.0582227Z at MongoDB.Driver.MongoClient.<StartImplicitSessionAsync>d__26.MoveNext()
2018-08-09T09:06:04.0582406Z --- End of stack trace from previous location where exception was thrown ---
2018-08-09T09:06:04.0582762Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-08-09T09:06:04.0582941Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2018-08-09T09:06:04.0583294Z at MongoDB.Driver.MongoCollectionImpl`1.<UsingImplicitSessionAsync>d__91`1.MoveNext()
2018-08-09T09:06:04.0583494Z --- End of stack trace from previous location where exception was thrown ---
2018-08-09T09:06:04.0583670Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2018-08-09T09:06:04.0584382Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2018-08-09T09:06:04.0584581Z at MongoDB.Driver.MongoCollectionBase`1.<InsertOneAsync>d__64.MoveNext()
2018-08-09T09:06:04.1605265Z 2018-08-09T09:06:04.159+0000 I CONTROL [initandlisten] MongoDB starting : pid=3112 port=27020 dbpath=C:\Users\XXX\AppData\Local\Temp\xdol0kvu.gus34704c47a97744dda37b_27020 64-bit host=factoryvm-az49
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 39 (14 by maintainers)
All of our tests have the same structure:
For anyone who has found this issue recently, I can confirm that at least version
2.2.16
works, but some later versions (eg3.1.3
) do not.Ok, but I have that error on my local machine when I’m running tests with
dotnet test
command. So it cannot be error for only VSTS hosted agents.If it helps I have 100+ tests that use Mongo2Go package.
nothing special I guess:
netcoreapp2.2
deps:
Base class for every integration test:
and example test class:
task configuration on azure devops:
I’m going to close this issue and declare that Mongo2Go is NOT compatible with VSTS / Azure DevOps. see https://stackoverflow.com/a/44662712
Mongo2Go must open ports. If this is not possible, then there is absolutely no chance that we will get this up and running.
Should that example have a static field? It seems odd to dispose of a static field in a subclass’s instance method.
I think the problem may be related with .net core. Try to run them against net461. See: https://github.com/Mongo2Go/Mongo2Go/issues/48
@ppumkin It’s time to clone the repo and debug this! 😉
Sorry for the misinformation. We have the same problem on VSTS agents hosted on Windows and Ubuntu, and also on local machines. The same exception in all cases.
No, Mac (#43) and Linux (#47) works now super fine. I tested both successfully.
I have absolutely no clue what happens on VSTS and really hope some user figures out what’s wrong. Unfortunately VSTS is pretty 💩, because you can’t even login to the agent… Also, time is rare here, too. 😞