Unit test fails to send data to AppVeyor API

michiel's Avatar


09 Jul, 2018 09:50 AM

We're using .Net Core with xUnit and are upgrading our projects to .Net Core 2.1

One of our projects has a lot of unit tests (900+) and we receive the following error (this error always happens at the end of the test run, after 900+ test results reported):

[00:08:39] Starting test execution, please wait...
[00:08:54] dotnet.exe : [xUnit.net 00:00:13.1012291] When sending 'PUT http://localhost:1573/api/tests/batch' with body 
[00:08:54] '[{"testName":"Project.Name.Tests.Integration.Controllers.TestName","testFramework":"xUnit","fileName":"Project.Name.Tests.dll 
[00:08:54] (.NETCoreApp,Version=v2.1)","outcome":"Passed","durationMilliseconds":108,"StdOut":""}]', exception was thrown: Object reference not set to an instance of an object.
[00:08:54] At line:3 char:5
[00:08:54] +     & dotnet test $file.FullName --no-build
[00:08:54] +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[00:08:54]     + CategoryInfo          : NotSpecified: ([xUnit.net 00:0...e of an object.:String) [], RemoteException
[00:08:54]     + FullyQualifiedErrorId : NativeCommandError
[00:08:56] Total tests: 229. Passed: 229. Failed: 0. Skipped: 0.
[00:08:56] Test Run Failed.

I think http://localhost:1573/api/tests/batch points to some internal AppVeyor API to report test results.
I'm not sure what's going on here. Some of our other projects with xUnit and .Net Core 2.1 run fine, but they have less unit tests.
This project also builds correctly on .Net Core 2.0 and reports all the unit tests without a problem.

Unit tests are started with this script:

- ps: >-
    $files = Get-ChildItem -Path . -Filter *.Tests.csproj -Recurse
    foreach ($file in $files)
        & dotnet test $file.FullName --no-build
        if ($LastExitCode -ne 0)
  1. Support Staff 1 Posted by Owen McDonnell on 10 Jul, 2018 02:41 AM

    Owen McDonnell's Avatar

    Could you try turning off parallelism in the assembly as described here

    Basically, you just need to add this to your AssemblyInfo.cs file.

    [assembly: CollectionBehavior(DisableTestParallelization = true, MaxParallelThreads = 1)]
    If that doesn't work like magic then we'll have to create a separate project to repro, to which i can be added as a collaborator, and for which all config will be set in the UI.
  2. 2 Posted by michiel on 10 Jul, 2018 09:48 AM

    michiel's Avatar

    Thanks. Looks like this solves the issue.

  3. Support Staff 3 Posted by Owen McDonnell on 10 Jul, 2018 04:29 PM

    Owen McDonnell's Avatar

    Great that you're unblocked, but we would still like to dig a little deeper into why parallelism isn't working.
    If you have the time, a public repro (basically, a public version of your repository) of this issue would help a lot.

  4. Ilya Finkelshteyn closed this discussion on 09 Sep, 2018 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