Running tests with Mongo2Go

borkke's Avatar


18 Nov, 2018 08:28 AM

It looks like mongo2go is having a hard time finding available port.

waiting for connections on port 27018
waiting for connections on port 27019
waiting for connections on port 27020

Do you have some guidance on how to run unit tests with mongo2go?

I'm using cake and very simple appveyor.yml

version: 1.0.{build}
image: Visual Studio 2015
- cmd: powershell -Version 2.0 -ExecutionPolicy ByPass -File build.ps1 -script "build.cake" -target "Default" -verbosity normal
test: off

  1. Support Staff 1 Posted by Owen McDonnell on 20 Nov, 2018 12:21 AM

    Owen McDonnell's Avatar

    It looks like recent builds are succeeding, is this still a problem for you?

  2. 2 Posted by borkke on 20 Nov, 2018 08:34 PM

    borkke's Avatar

    Yes, it’s still an issue.
    Same thing, mongo2go is trying to find available port. You can see this in test report.

    Tests are timing out, I’m just not failing entire bild (this is only for now).

  3. Support Staff 3 Posted by Owen McDonnell on 21 Nov, 2018 08:06 AM

    Owen McDonnell's Avatar

    Is this running fine on your local machine?

    Take a look at this discussion.
    A brief look at your test code shows that you are not disposing the MondoDbRunner after each test.
    Perhaps its worth trying that.

  4. 4 Posted by borkke on 21 Nov, 2018 07:34 PM

    borkke's Avatar

    Yes it’s working fine locally.

    I am not disposing MongoDbRunner intentionality. I’m trying to reuse sinle instance throughout all my tests.

    I’m using this MongoFixture do deal with starting and stopping.

  5. Support Staff 5 Posted by Owen McDonnell on 22 Nov, 2018 01:46 AM

    Owen McDonnell's Avatar

    It may work locally due to many more system resources available.

    I would suggest that you access the build worker via RDP, run the tests manually, and possibly even monitor the processes that are created.

  6. Ilya Finkelshteyn closed this discussion on 22 Jan, 2019 09:00 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac