Unit Testing works but dotCover failes to run test: Unrecoverable Error
Yesterday I upgraded from ReSharper 8 and dotCover to ReSharper 10.0.2 and dotCover 10.0.2 in VS2013.
My unit test, which previously ran and could be coverd, now runs successfully, but when I try to cover it, it fails, telling me:
"Unit Test Runner failed to run tests: Client controller exception: unrecoverable error."
Please note that the project uses Fujitsus' netCobol, which was previously supported in dotCover.
Does anyone have an idea, why this happens?
Thanks in advance!
Jannik
________________________________
The Log states:
09:42:50.559 |I| CoverageSession#1 | Starting coverage session
09:42:50.559 |I| CoverageSession#1 | Expected configuration ids: '12908c62-c53a-44db-aac6-a2454262e8bd'
09:42:50.560 |I| SettingsBasedFiltersProvider | Predefined coverage filters enabled
09:42:50.561 |I| CoverageSession#1 | Queueing add configuration command (configuration id: '12908c62-c53a-44db-aac6-a2454262e8bd')
09:42:50.561 |I| CoverageSession#1 | Adding configuration (configuration id: '12908c62-c53a-44db-aac6-a2454262e8bd')
09:42:50.561 |I| CoverageSession#1 | Queueing configuration execution (configuration id: '12908c62-c53a-44db-aac6-a2454262e8bd')
09:42:50.561 |I| CoverageSession#1 | Executing configuration (configuration id: '12908c62-c53a-44db-aac6-a2454262e8bd')
09:42:50.561 |I| CoverageSession#1 | Launching coverage analysis (configuration id: '12908c62-c53a-44db-aac6-a2454262e8bd')
09:42:50.932 |I| CoverageSession#1 | Waiting for the analysis to finish (configuration id: '12908c62-c53a-44db-aac6-a2454262e8bd')
09:42:52.376 |I| UnitTestServer | 127.0.0.1:50025 connected
09:42:52.843 |I| TaskRunnerLogPaketListener |
09:42:52.844 |I| TaskRunnerLogPaketListener |
09:42:52.893 |W| UnitTestLaunch | Can not find element for task: 8881aedf-c02a-4b45-9438-b296f51052bb
09:43:05.350 |W| CommandProcessor | OnLogAlert severity=Error hr=80004005 message='Invalid command new address
[location] = c:\build agent\work\a138fae29c728e1a\profiler\kernel\windows\native\solution\core\src\il\InjectILMethod.h(148)
[function] = void __thiscall InjectILMethod::AddressInfo::Check_MainPass(void) const
[method name] = MAPTA-ZUGRIFF_ABRECHNUNG.$43A6FD8
[module name] = C:\Users\jarndt\Source\HAMVS\MAPMAS20\dev\head\src\MAPMAS20.Test.Cobol\bin\Debug\Basisfunktionen.exe
[token] = 0600156B
[type name] = Basisfunktionen.PARGANTfuerUnitTests'
09:43:07.819 |W| CommandProcessor | OnLogAlert severity=Warning hr=ABAD0003 message='Operation is ignored because unrecoverable error is detected
[location] = src\Profiler\Coverage\BaseApiCoverageProfiler.Operation.cpp(74)
[function] = void __thiscall BaseApiCoverageProfiler::OperationStop(bool)
[hresult] = abad0003, CORE_API_E_UNRECOVERABLE_ERROR, Unrecoverable error was detected'
09:43:07.831 |E| RemoteCoverageHostProviderModel | CC [AppDomain:1] [EXC] Unrecoverable error [MSTest] Details: JetBrains.Profiler.Windows.Api.ProfilingApiException: Unrecoverable error at JetBrains.Profiler.Windows.Api.Impl.Helper.CheckHResult(HResults hr) at JetBrains.Profiler.Windows.Api.CoverageProfiler.Stop() at JetBrains.dotCover.UnitTesting.ClientController.CoverageTaskRunnerClientController.HandleTaskFinished(ITaskHierarchy taskHierarchy) at JetBrains.Common.UnitTesting.ClientController.ClientControllerEventsProcessor.DoAfterTaskFinished(ITask task, ClientControllerExceptionsPack exceptionsPack)
--- EXCEPTION #1/1 [LoggerException]
Message = “
CC [AppDomain:1] [EXC] Unrecoverable error [MSTest]
Details:
JetBrains.Profiler.Windows.Api.ProfilingApiException: Unrecoverable error
at JetBrains.Profiler.Windows.Api.Impl.Helper.CheckHResult(HResults hr)
at JetBrains.Profiler.Windows.Api.CoverageProfiler.Stop()
at JetBrains.dotCover.UnitTesting.ClientController.CoverageTaskRunnerClientController.HandleTaskFinished(ITaskHierarchy taskHierarchy)
at JetBrains.Common.UnitTesting.ClientController.ClientControllerEventsProcessor.DoAfterTaskFinished(ITask task, ClientControllerExceptionsPack exceptionsPack)
”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
at JetBrains.Common.UnitTesting.HostController.ProfilerTaskRunnerHostControllerBase.HandleClientMessagePack(ClientControllerExceptionsPack exceptionsPack)
at JetBrains.DataFlow.Signal`1.NotifySinks(TValue payload)
at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie)
at JetBrains.DataFlow.Signal`1.Fire(TValue value)
at JetBrains.Common.UnitTesting.HostController.ProfilerPacketHandler.Accept(RemoteTask remoteTask, IDictionary`2 attributes, XmlReader reader, IRemoteChannel remoteChannel)
at JetBrains.ReSharper.UnitTestExplorer.RemoteChannel.TaskRunnerEventsListener.OnTaskPacket(String packetName, IDictionary`2 attributes, RemoteTask remoteTask, XmlReader reader, IRemoteChannel remoteChannel)
at JetBrains.ReSharper.UnitTestExplorer.RemoteChannel.TaskRunnerEventsListener.OnPacket(XmlReader reader, IRemoteChannel remoteChannel)
at JetBrains.ReSharper.TaskRunnerFramework.RemoteChannel.ReaderThreadProc()
at JetBrains.ReSharper.TaskRunnerFramework.RemoteChannel.<Start>b__0(Object _)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
”
09:43:07.853 |I| CoverageSession#1 | Queueing abort command
09:43:07.855 |I| CoverageSession#1 | Handling session finish
09:43:07.864 |W| CommandProcessor | OnLogAlert severity=Warning hr=ABAD0003 message='Operation is ignored because unrecoverable error is detected
[location] = src\Profiler\Coverage\BaseApiCoverageProfiler.Operation.cpp(74)
[function] = void __thiscall BaseApiCoverageProfiler::OperationStop(bool)
[hresult] = abad0003, CORE_API_E_UNRECOVERABLE_ERROR, Unrecoverable error was detected'
09:43:08.087 |I| CoverageSession#1 | LogDone event recieved. Queueing handler (configuration id: '12908c62-c53a-44db-aac6-a2454262e8bd')
09:43:08.400 |I| CoverageSession#1 | Finished event recieved. Queueing handler (configuration id: '12908c62-c53a-44db-aac6-a2454262e8bd')
09:43:08.400 |I| CoverageSession#1 | Analysis finished (configuration id: '12908c62-c53a-44db-aac6-a2454262e8bd')
09:43:08.865 |I| CoverageSession#1 | Log file received: C:\Users\jarndt\AppData\Local\Temp\JetLogs\JetBrainsLog.JetBrains.2016-01-12T09-14-31.devenv#1236.Core#1.log
09:43:08.865 |I| CoverageSession#1 | Session is already finished. Ingnoring log.
09:43:08.865 |I| CoverageSession#1 | Configuration finished (configuration id: '12908c62-c53a-44db-aac6-a2454262e8bd')
09:43:08.865 |I| CoverageSession#1 | Handling session finish
09:43:08.866 |I| CoverageSession#1 | Setting SessionFinishedEvent
09:43:08.867 |I| CoverageSession#1 | Executing 'finish' callback after session lifetime termination (configuration id: '12908c62-c53a-44db-aac6-a2454262e8bd')
09:44:23.273 |I| UnitTestLaunch | Aborting launch
09:44:23.273 |I| UnitTestLaunch | Cancelling all active runs
09:44:23.273 |I| UnitTestLaunch | Aborting launch
09:44:23.273 |I| UnitTestLaunch | Aborting all active runs
Please sign in to leave a comment.
Hi Jannik,
I answered you in this ticket https://jbs.zendesk.com/agent/tickets/612130 some time ago, but unfortunately have no response from you.
Do you still experience this problem? If yes, are you able to reproduce the issue in a sample solution and send it to us
Best regards,
Fedor.
I'm running into the exact same problem. What did you suggest Jannik to fix this?
Hi! The suggestion was to send in an example-project, which I frankly don't have the time to.
Thus my solution was to re-install the previous version of dotCover (2.7, https://dotnettools-support.jetbrains.com/hc/en-us/articles/206546399-Where-can-I-download-previous-versions-of-dotCover-) and run it with the legacy key you get with an Ultimate License.
Good luck!
Hello Hari,
Unfortunately we indeed need an example of a problem application in order to reproduce and investigate the issue. It would be very appreciated if you could send us your executable files (we will sign NDA if necessary) or a sample solution.
Best regards.
Hello Ekaterina,
Sorry I missed your response post. I'm using this GitHub library called Smocks to mock static methods.
https://github.com/vanderkleij/Smocks (This project has unit tests that also have the issue when run thru dotCover)
Since this is an opensource alpha library, I don't expect you guys to jump in immediately but any pointers will be very helpful :)
Thanks in advance.
Here's part of the dotCover log file with the exception (Let me know if you need the entire log file)-
000016CC 1 000000002201F1A0 IVG::Inject mid=000007FE9A231CD8 fid=000007FE9A8FD6E0 mdtk=0600004B res=exception fname='<TestMockDateTimeNowMethod>b__0' cname='Strata.CS.Base.Test.StaticMocking.StaticMockExampleTest' spCount=5
FatMethod flags=Imc size=12 maxStack=4 codeSize=0000007B tk=1100001C
:0:
00000000 00 nop
:1:
00000001 1200 ldloca.s 00
00000003 20D0070000 ldc.i4 000007D0
00000008 17 ldc.i4.1
00000009 17 ldc.i4.1
0000000A 281600000A call 0A000016
0000000F 00 nop
:2:
00000010 02 ldarg.0
00000011 14 ldnull
00000012 D00C00000A ldtoken 0A00000C
00000017 280D00000A call 0A00000D
0000001C 7443000001 castclass 01000043
00000021 287000000A call 0A000070
00000026 16 ldc.i4.0
00000027 8D3D000001 newarr 0100003D
0000002C 280800002B call 2B000008
00000031 6F0900002B callvirt 2B000009
00000036 06 ldloc.0
00000037 6F7200000A callvirt 0A000072
0000003C 6F7300000A callvirt 0A000073
00000041 00 nop
:3:
00000042 16 ldc.i4.0
00000043 8D0C000001 newarr 0100000C
00000048 0B stloc.1
00000049 07 ldloc.1
0000004A D00C00000A ldtoken 0A00000C
0000004F 280D00000A call 0A00000D
:4: (invalid)
00000054 280100002B call 2B000001
00000059 0C stloc.2
0000005A 08 ldloc.2
0000005B 6F0F00000A callvirt 0A00000F
00000060 2C08 brfalse.s @br0 (0000006A)
00000062 08 ldloc.2
00000063 6F1000000A callvirt 0A000010
00000068 2B05 br.s @br1 (0000006F)
@br0:
0000006A 280C00000A call 0A00000C
@br1:
0000006F 8C09000001 box 01000009
00000074 287400000A call 0A000074
00000079 00 nop
0000007A 2A ret
EndCommands
EndMethod
000016CC 1 000000002201F1A0 ERROR: Jump to invalid address
'[location] = src\IL\InjectILMethod.MainPass.cpp(358)'
'[function] = unsigned long __cdecl InjectILMethod::Translate(unsigned long,bool)'
'[method name] = <TestMockDateTimeNowMethod>b__0'
'[module name] = C:\Users\hgutta\AppData\Local\Temp\52a44f03-9969-4bce-bdbe-9b1ed35401f7.exe'
'[token] = 0600004B'
'[type name] = Strata.CS.Base.Test.StaticMocking.StaticMockExampleTest'
00003E04 1 0000000000000000 CPool::Delete
00003E04 1 0000000000000000 BPool::Delete
000029EC 1 000000002039A130 BACProf::ApiStop
000029EC 1 000000002039A130 WARNING: Operation is ignored because unrecoverable error is detected
'[location] = src\Profiler\Coverage\BaseApiCoverageProfiler.Operation.cpp(74)'
'[function] = void __cdecl BaseApiCoverageProfiler::OperationStop(bool)'
'[hresult] = abad0003, CORE_API_E_UNRECOVERABLE_ERROR, Unrecoverable error was detected'
000029EC 1 000000002039A130 BACProf::ApiStop
000029EC 1 000000002039A130 WARNING: Operation is ignored because unrecoverable error is detected
'[location] = src\Profiler\Coverage\BaseApiCoverageProfiler.Operation.cpp(74)'
'[function] = void __cdecl BaseApiCoverageProfiler::OperationStop(bool)'
'[hresult] = abad0003, CORE_API_E_UNRECOVERABLE_ERROR, Unrecoverable error was detected'
Hi Hari,
Thanks a lot for the information!
We are investigating the issue (https://youtrack.jetbrains.com/issue/DCVR-8116).
Thanks Ekaterina. You folks are awesome.
Hi Hari,
We have finished the investigation and we believe that the cause of the problem in your case is that Smocks library modifies IL-code in assemblies, updates pdb-files for them, but doesn't update assemblies mvids. As a result dotCover meets different assemblies with the same mvids and can't process pdb-files correctly.
I've created a pull request for the Smocks repository that fixes the problem: https://github.com/vanderkleij/Smocks/pull/16.
Hi Ekaterina,
I can't thank you enough for looking into this. I've applied this into our code and your fix works.
5 stars for the quick turn around :D
Best,
Hari
Hi, I'm running into this same error with about 20 of our tests and we were stumped on the issue until I found this thread.
Tests pass fine, but we consistently get the same unrecoverable error when running coverage on them.
We're using Moq and XUnit. I can put one of the tests into a little project and provide it to you if needed. Here is the snippit from the log file:
SmallSection kind=01 flags=m dataSize=00000010
0: SmallEh flags=lFad tryOffset=0029 tryLength=37 (0060) handlerOffset=0060 handlerLength=0D (006D)
EndSection
EndMethod
000024F0 1 00000089776703C0 ERROR: Inconsistent PDB detected, unsequentional offset in statement table
'[location] = src\IL\Var\ILMethodVar.cpp(36)'
'[function] = unsigned short __cdecl ILMethodVar::BeginInject(struct IWriteCoreStream *,unsigned long)'
'[method name] = get_MatchingEvidenceCount'
'[module name] = C:\Users\bdrew\AppData\Local\Temp\b7a9e176-b886-4962-9206-4cc90ec1f40b\6321a242-dc7f-4294-8896-03cdab2c6f9e\assembly\dl3\57d1e59a\1741bdd0_32d2d101\[-namespaceremoved-].ViewModels.dll'
'[token] = 06000908'
'[type name] = [-namespaceremoved-].ViewModels.Explorers.DatabaseExplorerViewModel'
000024F0 1 00000089776703C0 BACProf::ApiStop
000024F0 1 00000089776703C0 WARNING: Operation is ignored because unrecoverable error is detected
'[location] = src\Profiler\Coverage\BaseApiCoverageProfiler.Operation.cpp(74)'
'[function] = void __cdecl BaseApiCoverageProfiler::OperationStop(bool)'
'[hresult] = abad0003, CORE_API_E_UNRECOVERABLE_ERROR, Unrecoverable error was detected'
00000438 1 0000000000000000 CPool::Delete
00000438 1 0000000000000000 BPool::Delete
00006BE8 1 0000008977857D10 BACProf::ApiStop
00006BE8 1 0000008977857D10 WARNING: Operation is ignored because unrecoverable error is detected
'[location] = src\Profiler\Coverage\BaseApiCoverageProfiler.Operation.cpp(74)'
'[function] = void __cdecl BaseApiCoverageProfiler::OperationStop(bool)'
'[hresult] = abad0003, CORE_API_E_UNRECOVERABLE_ERROR, Unrecoverable error was detected'
Hi Guys.
I've run into the same problem as my predecessors. We're using the Nunit + Moq + fluent assertions + autofixture. The tests run and debug works fine, but the code coverage cannot start.
2016.11.30 13:06:13.075 ERROR Coverage analysis: No rage info for token
[location] = src\Profiler\Coverage\module_gatherer.cpp(153)
[function] = void __cdecl jetbrains::profiler::module_gatherer::get_statement_mask(unsigned int,unsigned int,const class std::vector<enum filter_types,class std::allocator<enum filter_types> > &,class std::vector<struct jetbrains::profiler::inplace_array<unsigned int,bool> const *,class std::allocator<struct jetbrains::profiler::inplace_array<unsigned int,bool> const *> > &) (C:\Users\PLMIKUB\AppData\Local\JetBrains\Installations\ReSharperPlatformVs14_001\JetBrains.ReSharper.TaskRunner.CLR45.x64.exe [pid=18316])
2016.11.30 13:06:13.162 ERROR Coverage analysis: ClientController error: Unrecoverable error
Best Regards,
Miłosz