Bug 41921 - NUnit2 and NUnit3 testing Internal Error
Summary: NUnit2 and NUnit3 testing Internal Error
Status: RESOLVED DUPLICATE of bug 43522
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: NUnit (show other bugs)
Version: 6.0.0 (C7)
Hardware: Macintosh Mac OS
: High normal
Target Milestone: (C8SR1)
Assignee: Marius Ungureanu
URL:
Depends on:
Blocks:
 
Reported: 2016-06-17 07:13 UTC by Fokke Vermeulen
Modified: 2016-10-15 12:11 UTC (History)
14 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Check local copy (119.67 KB, image/png)
2016-08-09 13:56 UTC, Marius Ungureanu
Details

Description Fokke Vermeulen 2016-06-17 07:13:08 UTC
I get this error, when I try to load the unitTests. Don't know what I should do now. I updated to Xamarin Studio 6.
At first the tests worked, but then I got this error.

Internal error
AggregateException: One or more errors occurred.
Stack trace:
  at System.Threading.Tasks.Task.ThrowIfExceptional (Boolean includeTaskCanceledExceptions) [0x00014] in /private/tmp/source-mono-4.4.0-c7-baseline/bockbuild-mono-4.4.0-c7-baseline/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2157 
  at System.Threading.Tasks.Task`1[TResult].GetResultCore (Boolean waitCompletionNotification) [0x00034] in /private/tmp/source-mono-4.4.0-c7-baseline/bockbuild-mono-4.4.0-c7-baseline/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/Tasks/Future.cs:562 
  at System.Threading.Tasks.Task`1[TResult].get_Result () [0x00000] in /private/tmp/source-mono-4.4.0-c7-baseline/bockbuild-mono-4.4.0-c7-baseline/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/Tasks/Future.cs:532 
  at MonoDevelop.UnitTesting.NUnit.NUnitAssemblyTestSuite.RunUnitTest (MonoDevelop.UnitTesting.UnitTest test, System.String suiteName, System.String pathName, System.String testName, MonoDevelop.UnitTesting.TestContext testContext) [0x0014a] in /Users/builder/data/lanes/3342/694a75f0/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitAssemblyTestSuite.cs:424
Comment 1 Timothy M 2016-06-19 18:29:19 UTC
I got that exception as well when first opening Xamarin studio in the current version (v6.0 build 5174). I first assumed it was some error I was making, and the tests showed passing in the unit tests view.

After some messing around with the tests, I discovered that new tests are being registered in the nunits test view and will be run, but will result in an internal exception:

    Object reference not set to an instance of an object
    Stack trace:
      at MonoDevelop.UnitTesting.TestRecordCollection.get_Item (System.String name) [0x00007] in /Users/builder/data/lanes/3342/694a75f0/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractResultsStore.cs:383 
      at MonoDevelop.UnitTesting.AbstractResultsStore.RegisterResult (System.String configuration, MonoDevelop.UnitTesting.UnitTest test, MonoDevelop.UnitTesting.UnitTestResult result) [0x00078] in /Users/builder/data/lanes/3342/694a75f0/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractResultsStore.cs:70 
      at MonoDevelop.UnitTesting.UnitTest.RegisterResult (MonoDevelop.UnitTesting.TestContext context, MonoDevelop.UnitTesting.UnitTestResult result) [0x00055] in /Users/builder/data/lanes/3342/694a75f0/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTest.cs:343 
      at MonoDevelop.UnitTesting.UnitTest.Run (MonoDevelop.UnitTesting.TestContext testContext) [0x0004b] in /Users/builder/data/lanes/3342/694a75f0/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTest.cs:290 
      at MonoDevelop.UnitTesting.TestSession.RunTests () [0x00028] in /Users/builder/data/lanes/3342/694a75f0/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestService.cs:425 

Interestingly, the tests will be reported correctly in the nunit test view on the right (i.e. passing tests will get a checkmark, failing tests will get the x), however the test will not be reported (as if it didn't exist at all) in the Test Results tab at the bottom, unless the test is run specifically in the Unit Tests tab.
Comment 2 Ilber Ibrahimi 2016-06-27 08:49:11 UTC
Same error here:

One or more errors occurred.
Stack trace:
  at System.Threading.Tasks.Task.ThrowIfExceptional (Boolean includeTaskCanceledExceptions) [0x00014] in /private/tmp/source-mono-4.4.0-c7sr0/bockbuild-mono-4.4.0-branch-c7sr0/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2157 
  at System.Threading.Tasks.Task`1[TResult].GetResultCore (Boolean waitCompletionNotification) [0x00034] in /private/tmp/source-mono-4.4.0-c7sr0/bockbuild-mono-4.4.0-branch-c7sr0/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/Tasks/Future.cs:562 
  at System.Threading.Tasks.Task`1[TResult].get_Result () [0x00000] in /private/tmp/source-mono-4.4.0-c7sr0/bockbuild-mono-4.4.0-branch-c7sr0/profiles/mono-mac-xamarin/build-root/mono-x86/external/referencesource/mscorlib/system/threading/Tasks/Future.cs:532 
  at MonoDevelop.UnitTesting.NUnit.NUnitAssemblyTestSuite.RunUnitTest (MonoDevelop.UnitTesting.UnitTest test, System.String suiteName, System.String pathName, System.String testName, MonoDevelop.UnitTesting.TestContext testContext) [0x0014a] in /Users/builder/data/lanes/3422/e879ce52/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitAssemblyTestSuite.cs:424 

No idea what is going wrong but the new Xamarin Studio does not look stable anymore.
Comment 3 Timothy M 2016-07-03 16:17:24 UTC
Appears to be resolved in 6.0.1 build 9
Comment 4 Manish Sinha 2016-07-26 19:17:26 UTC
@Fokke and Ilber

can you try and see if you can reproduce this issue with alpha XS which is 6.1.0.x
Comment 5 Jean-Marie Gueirard 2016-08-09 09:40:07 UTC
I'm still facing the issue on 6.0.2, also tried with alpha build 6.1 5298:

One or more errors occurred.
Stack trace:
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00014] in /private/tmp/source-mono-4.6.0/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2158 
  at System.Threading.Tasks.Task`1[TResult].GetResultCore (System.Boolean waitCompletionNotification) [0x00034] in /private/tmp/source-mono-4.6.0/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs:563 
  at System.Threading.Tasks.Task`1[TResult].get_Result () [0x00000] in /private/tmp/source-mono-4.6.0/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs:533 
  at MonoDevelop.UnitTesting.NUnit.NUnitAssemblyTestSuite.RunUnitTest (MonoDevelop.UnitTesting.UnitTest test, System.String suiteName, System.String pathName, System.String testName, MonoDevelop.UnitTesting.TestContext testContext) [0x0014a] in /Users/builder/data/lanes/3509/54c11312/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitAssemblyTestSuite.cs:424 
[MVID] 60e32ad46a3845ff8d391f90e6d8bc72 3
[MVID] 7747cf446af449e194e4b4e70d85e773 0,1,2
Comment 6 Marius Ungureanu 2016-08-09 13:56:36 UTC
Created attachment 16955 [details]
Check local copy
Comment 7 Marius Ungureanu 2016-08-09 13:57:05 UTC
Can you check whether the nunit.framework reference is being locally copied? This should be ticked like in the attachment above.
Comment 8 xamarin-release-manager 2016-08-09 18:17:55 UTC
Fixed in version 6.2.0.322 (master)

Author: therzok
Commit: 87c12bde3ca0c307a9ef60b6170d030242934131 (mono/monodevelop)
Comment 9 Jatin 2016-08-10 09:09:29 UTC
I tried to reproduce this issue with the build:

XS Version 6.0 (build 5174)

Build Information
Release ID: 600005174
Git revision: 694a75f040b7f2309bc43d4f78a3a6572ca898bf
Build date: 2016-06-01 17:28:08-04
Xamarin addins: 33f406fa2dcf214012c78cb846585f062b2e1d24
Build lane: monodevelop-lion-cycle7-baseline

But could not able to reproduce it successfully, as the nunit.framework reference is being locally copied.

Also, with the latest master build as well as the latest cycle 8 build, the issue is not appearing, as on opening the NUnit project the exception is not appearing and the nunit.framework reference is being locally copied.

Below are the steps I followed for the same:

1. Open the XS
2. Open NUnit project
3. Added the NUnit package
4. Observe that under the reference folder the nunit.framework reference is being locally copied.

Below is the screencast for the same:
http://www.screencast.com/t/tTW3Ahlcrrr

Build informations:

Master: 

XS Version 6.2 (build 325)

Build Information
Release ID: 602000325
Git revision: cf09ab45fd514efdfa0c2601f2a3473840cd6cd3
Build date: 2016-08-09 15:26:42-04
Xamarin addins: ff668dc5e498be4ac6b2e4407d7d8aead77434b8
Build lane: monodevelop-lion-master

Cycle 8:

XS Version 6.1 (build 5318)

Build Information
Release ID: 601005318
Git revision: 3df31ff918786d5615ecd46232e9981fcadc1f6f
Build date: 2016-08-09 16:19:25-04
Xamarin addins: 6385276b8f00aec6c745543b5e4ba42aa02caa6b
Build lane: monodevelop-lion-cycle8

Please review the screencast provided above. Also let us know if any additional scenarios we need to cover for this. So that we can verify and close this issue.
Comment 10 Marius Ungureanu 2016-08-10 10:34:45 UTC
@Jatin: To reproduce the issue, Local Copy must not be set.
Comment 11 Manish Sinha 2016-08-10 16:55:00 UTC
Verified on Version 6.1 (build 5319)

https://gist.github.com/083d3cfecd5abdcb81e051a0ed7c19be
Comment 12 xamarin-release-manager 2016-08-10 17:26:35 UTC
Fixed in version 6.1.0.5324 (cycle8)

Author: Greg Munn
Commit: a39abce1dd066c159a3258acaa4e871fd70e4194 (mono/monodevelop)
Comment 13 Joe B 2016-09-13 21:06:26 UTC
Still getting this error on unit test runs in Version 6.1 (build 5441)
One or more errors occurred.
Stack trace:
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00014] in /private/tmp/source-mono-4.6.0/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2157 
  at System.Threading.Tasks.Task`1[TResult].GetResultCore (System.Boolean waitCompletionNotification) [0x00034] in /private/tmp/source-mono-4.6.0/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs:562 
  at System.Threading.Tasks.Task`1[TResult].get_Result () [0x00000] in /private/tmp/source-mono-4.6.0/bockbuild-xamarin/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs:532 
  at MonoDevelop.UnitTesting.NUnit.NUnitAssemblyTestSuite.RunUnitTest (MonoDevelop.UnitTesting.UnitTest test, System.String suiteName, System.String pathName, System.String testName, MonoDevelop.UnitTesting.TestContext testContext) [0x0014a] in /Users/builder/data/lanes/3509/68292d1a/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting.NUnit/MonoDevelop.UnitTesting.NUnit/NUnitAssemblyTestSuite.cs:424
Comment 14 Joe B 2016-09-13 21:08:59 UTC
In addition I checked to local copy on the NUnit reference and ran, still get the error.  Also unchecked it and ran, still get the error.
Comment 15 Joe B 2016-09-13 21:09:41 UTC
In addition I checked to local copy on the NUnit reference and ran, still get the error.  Also unchecked it and ran, still get the error.
Comment 16 Lluis Sanchez 2016-09-14 09:51:57 UTC
Reopening.
Comment 17 Damien B. 2016-09-27 07:50:59 UTC
I have the same problem and this is very blocker to run my tests in Xamarin Studio 6.1.1
Comment 18 Stefano 2016-09-27 09:17:38 UTC
Same issue on XS 6.1.1 (build 15).
Test results ends with "Internal error" :
Object reference not set to an instance of an object
Stack trace:
  at MonoDevelop.UnitTesting.TestRecordCollection.get_Item (System.String name) [0x00007] in /Users/builder/data/lanes/3816/fa52f026/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractResultsStore.cs:383 
  at MonoDevelop.UnitTesting.AbstractResultsStore.RegisterResult (System.String configuration, MonoDevelop.UnitTesting.UnitTest test, MonoDevelop.UnitTesting.UnitTestResult result) [0x00078] in /Users/builder/data/lanes/3816/fa52f026/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting/Services/AbstractResultsStore.cs:70 
  at MonoDevelop.UnitTesting.UnitTest.RegisterResult (MonoDevelop.UnitTesting.TestContext context, MonoDevelop.UnitTesting.UnitTestResult result) [0x00055] in /Users/builder/data/lanes/3816/fa52f026/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTest.cs:343 
  at MonoDevelop.UnitTesting.UnitTest.Run (MonoDevelop.UnitTesting.TestContext testContext) [0x0004b] in /Users/builder/data/lanes/3816/fa52f026/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTest.cs:290 
  at MonoDevelop.UnitTesting.TestSession.RunTests () [0x00028] in /Users/builder/data/lanes/3816/fa52f026/source/monodevelop/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestService.cs:426 

The same tests have successfully passed in CLI using NUnit Console Runner 3.0.5813.
Comment 19 Marius Ungureanu 2016-10-05 12:45:32 UTC

*** This bug has been marked as a duplicate of bug 43522 ***

Note You need to log in before you can comment on or make changes to this bug.