Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NUnit3 / Teamcity TestExecutionException: Cannot start monitoring test...
royboy23
#1 Posted : Saturday, April 18, 2020 8:38:36 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/3/2014(UTC)
Posts: 11
Location: Germany

Thanks: 2 times
Hi,

I am working on a project with about 1500 Nunit tests and use Ncrunch on both my Dev machine and my Teamcity server. Since updating NUnit from 2.6.3 to version 3.12.0, I am having problems with my unit tests on the TeamCity Server.

The tests are still run and all are passing, however, I get lots of build errors such as this one:

nCrunch.TestExecution.TestExecutionException: Cannot start monitoring test 'Zeiterfassung.UnitTests.Model.HourlyRates.HourlyRatesViewModelTest.' - test Zeiterfassung.UnitTests.Model.HourlyRates.HourlyRateSummaryTests. is still being monitored
at nCrunch.TestExecution.TestExecutionMonitor.StartMonitoringTest(ExecutingTest test)
at nCrunch.TestExecution.ExecutingTest.Start()
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.suiteStarted(NUnit3Message message)
at nCrunch.Module.NUnit3.Integration.NUnit3Listener.RaiseCallbackEvent(String eventArgument)

As a result, my Build is marked as failed in Teamcity.

I have no problems running the same tests in Visual Studio 2019 with NCrunch. The problems only occur in TeamCity.

Please let me know how to fix this.

Thanks,

Adrian

royboy23
#2 Posted : Saturday, April 18, 2020 8:40:55 PM(UTC)
Rank: Member

Groups: Registered
Joined: 3/3/2014(UTC)
Posts: 11
Location: Germany

Thanks: 2 times
Just in case it matters, this is the command from my TeamCity NCrunch build step:

"%system.teamcity.build.checkoutDir%\MySolutionName.sln" /c c:\globalconfig.crunch.v3.xml /o "%system.teamcity.build.checkoutDir%\NCrunchResults" -NCrunchCacheStoragePath C:\NCrunchTestRunnerCache

Thanks,

Adrian
Remco
#3 Posted : Sunday, April 19, 2020 12:39:27 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,049

Thanks: 787 times
Was thanked: 1023 time(s) in 974 post(s)
Hi Adrian,

Thanks for sharing this issue.

This error appears when the sequence of events provided by NUnit is inconsistent. NUnit did not send a completion message for the previous fixture before it sent a message saying that the next test had started its execution (invalid sequence).

Are you using any NUnit plugins or modifications of any kind?

Do you have parallel execution turned on for NUnit? Note that there are several ways to do this (check them all).

Can you get a capture of the test run containing the error with LogVerbosity set to Detailed? You can submit this via the NCrunch contact form.
royboy23
#4 Posted : Sunday, April 19, 2020 8:52:42 AM(UTC)
Rank: Member

Groups: Registered
Joined: 3/3/2014(UTC)
Posts: 11
Location: Germany

Thanks: 2 times
Hi Remco,

thanks for the quick reply. The issue was that I had marked my test fixture base with [Parallelizable(ParallelScope.All)] . I thought Once I removed this, the problem on Teamcity went away. Naturally, my tests are not parallelized anymore when I use a different test runner, but usually Ncrunch is stable enough so that I don't have to do that.

Thanks again for your help!

Best Regards,

Adrian

P.S.: The new "Optimized" instrumentation mode is great! Well worth getting the update just for this feature :-)
Remco
#5 Posted : Monday, April 20, 2020 5:06:48 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,049

Thanks: 787 times
Was thanked: 1023 time(s) in 974 post(s)
Thanks for confirming that this was the problem!

I'm glad the new instrumentation mode is working well for you. I look forward to making this the default mode of operation in future :)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.038 seconds.