nunit console runner 3.4.1 hangs after finishing

r.baeriswyl's Avatar

r.baeriswyl

14 Oct, 2016 06:56 AM

As the subject says, builds from my repository started to hang after the tests were run. The last messages are:
> Results (nunit3) saved as TestResult.xml
> Exception encountered unloading AppDomain
If I connect to the build machine, I see that two nunit console runners are still open. If I close them, the build finishes.
This started suddenly after I added some more tests.
The last build which worked is: https://ci.appveyor.com/project/RomanBaeriswyl/flaui/build/190
and the first which had this problem is: https://ci.appveyor.com/project/RomanBaeriswyl/flaui/build/191
The tests added between 190 and 191 are similar to almost all other tests.
What could cause this problem? Maybe the recently released version of the nunit console runner (3.5.0) fixes this issue?
Thanks for your help.
Roman

  1. 1 Posted by Ilya Finkelshte... on 15 Oct, 2016 01:12 AM

    Ilya Finkelshteyn's Avatar

    Hello,

    Could you please send your appveyor.yml for us to experiment with your build? I see that you use UI, so please use Export YAML menu.

    I added issue about new nunit here https://github.com/appveyor/ci/issues/1113.

    --ilya.

  2. 2 Posted by r.baeriswyl on 17 Oct, 2016 05:33 AM

    r.baeriswyl's Avatar

    Here's my YAML;

    version: '{build}'
    assembly_info:
      patch: true
      file: '**\AssemblyInfo.*'
      assembly_version: $(Major).$(Minor)
      assembly_file_version: $(Major).$(Minor).$(Patch).{build}
      assembly_informational_version: $(Major).$(Minor).$(Patch)
    environment:
      Major: 0
      Minor: 3
      Patch: 3
    install:
    - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
    nuget:
      disable_publish_on_pr: true
    before_build:
    - cmd: nuget restore src\FlaUI.sln
    build:
      project: src\FlaUI.sln
      publish_nuget: true
      include_nuget_references: true
      verbosity: minimal
    deploy: off
    notifications:
    - provider: Webhook
      url: https://webhooks.gitter.im/e/xxxxxx
      method: POST
      on_build_success: true
      on_build_failure: true
      on_build_status_changed: true
    on_finish:
    - ps: >-
        if (Test-Path -path c:\FailedTestsScreenshots) { Get-ChildItem c:\FailedTestsScreenshots*.* | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }}
        # $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
    
  3. 3 Posted by r.baeriswyl on 17 Oct, 2016 05:56 AM

    r.baeriswyl's Avatar

    I'm playing around with ignoring some tests, still working on that. But something else I now get is the following message:

    Error processing test event: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
       at System.Collections.Concurrent.ConcurrentDictionary`2.get_Item(TKey key)
       at Appveyor.NUnit3Logger.AppveyorTestEventListener.TestFinished(XElement testCase)
       at Appveyor.NUnit3Logger.AppveyorTestEventListener.OnTestEvent(String report)
    Test event element: <test-case id="1-1055" name="GridPatternTest" fullname="FlaUI.Core.UITests.Elements.ListViewTests(UIA2,WinForms).GridPatternTest" methodname="GridPatternTest" classname="FlaUI.Core.UITests.Elements.ListViewTests" runstate="Runnable" seed="2070889305" result="Skipped" label="Ignored" site="Parent" start-time="0001-01-01 00:00:00Z" end-time="0001-01-01 00:00:00Z" duration="0.000000" asserts="0" parentId="1-1054"><reason><message><![CDATA[OneTimeSetUp: Ignore for testing reasons]]></message></reason></test-case>
    
    I think this happens for each test I ignore (with the IgnoreAttribute on the Fixture). This is something different but maybe this is also worth checking out.
  4. 4 Posted by r.baeriswyl on 17 Oct, 2016 03:21 PM

    r.baeriswyl's Avatar

    I just found out a lot of things but could not fix the issue (except for some very hacky things). I think it is an issue with nUnit or even with Windows UI Automation. You see more details in my comment (Roemer) here: https://github.com/nunit/nunit-console/issues/43
    Moving to version 3.5 should at least let the builds complete with just a warning.

  5. 5 Posted by Ilya Finkelshte... on 18 Oct, 2016 02:39 AM

    Ilya Finkelshteyn's Avatar

    Hello,

    For workaround please add the following at install stage

    nuget install  NUnit.Console -OutputDirectory %SYSTEMDRIVE%\Tools\NUnit35
    set path=%SYSTEMDRIVE%\Tools\NUnit35\NUnit.ConsoleRunner.3.5.0\tools\;%path%
    mkdir %SYSTEMDRIVE%\Tools\NUnit35\NUnit.ConsoleRunner.3.5.0\tools\addins
    copy %SYSTEMDRIVE%\Tools\NUnit3\bin\addins %SYSTEMDRIVE%\Tools\NUnit35\NUnit.ConsoleRunner.3.5.0\tools\addins
    copy c:\Tools\NUnit3\bin\appveyor.addins %SYSTEMDRIVE%\Tools\NUnit35\NUnit.ConsoleRunner.3.5.0\tools
    

    I filed issue to add latest nunit to build worker VHD https://github.com/appveyor/ci/issues/1118

    Also thank you for the catch with KeyNotFoundException - looking into it now.

    --ilya.

  6. 6 Posted by r.baeriswyl on 18 Oct, 2016 08:03 AM

    r.baeriswyl's Avatar

    Thank you for the install script. This shows a warning but continues correctly so this works as workaround. Why the warning is shown seems to be an issue with the underlying technologies from Windows. So this issue can be closed.

  7. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:09 AM.

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

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