Running tests with Mongo2Go

borkke's Avatar

borkke

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
... https://ci.appveyor.com/project/borkke/opentracing-csharp-mongo/bui...

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
build_script:
- cmd: powershell -Version 2.0 -ExecutionPolicy ByPass -File build.ps1 -script "build.cake" -target "Default" -verbosity normal
test: off

https://github.com/borkke/opentracing-csharp-mongo/blob/master/buil...

  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.
    https://ci.appveyor.com/project/borkke/opentracing-csharp-mongo/builds/20390197/tests

    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.
    https://github.com/borkke/opentracing-csharp-mongo/blob/master/test/OpenTracing.Contrib.Mongo.Test/MongoFixture.cs

  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.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? 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