简体   繁体   English

单元测试调试停止时,摩尔崩溃

[英]Moles crashing when unit test debugging is being stopped

I'm using Pex and Moles Power Tools 0.94.51023.0 64-bit (en_visual_studio_2010_pex_0.94.51023.0_power_tools_x64_598803.exe) in Visual Studio 2010 SP1 (Windows 7 Enterprise 64-bit, all updates installed via Windows Update). 我正在Visual Studio 2010 SP1(Windows 7 Enterprise 64位,所有更新通过Windows Update安装)中使用Pex和Moles Power Tools 0.94.51023.0 64位(en_visual_studio_2010_pex_0.94.51023.0_power_tools_x64_598803.exe)。 Project is .NET 2.0, tests are running in 32-bit mode set explicitly in settings. 项目是.NET 2.0,测试以32位模式(在设置中明确设置)运行。 When run, everything is ok and no errors occur. 运行时,一切正常,没有错误发生。 But when I run tests in debug mode and stop before they finish, Moles are crashing: 但是,当我以调试模式运行测试并在测试完成之前停止时,Moles崩溃了:

Microsoft.Moles.VsHost stopped working
Problem signature:
  Problem Event Name:   CLR20r3
  Problem Signature 01: microsoft.moles.vshost.x86.exe
  Problem Signature 02: 0.94.0.0
  Problem Signature 03: 4cc31915
  Problem Signature 04: System.Runtime.Remoting
  Problem Signature 05: 4.0.0.0
  Problem Signature 06: 4ba1df86
  Problem Signature 07: e5
  Problem Signature 08: c9
  Problem Signature 09: System.Runtime.Remoting.Remoting
  OS Version:   6.1.7601.2.1.0.256.4
  Locale ID:    1033
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Attached debugger and got more detailed information: 附带调试器,并获得了更多详细信息:

The test adapter 'MolesAgentAdapter' threw an exception while running test 'My_Test_Method_Name'. Failed to read from an IPC Port: The pipe has been ended.

Call stack: 调用堆栈:

Server stack trace: 
   at System.Runtime.Remoting.Channels.Ipc.IpcPort.Connect(String portName, Boolean secure, TokenImpersonationLevel impersonationLevel, Int32 timeout)
   at System.Runtime.Remoting.Channels.Ipc.ConnectionCache.GetConnection(String portName, Boolean secure, TokenImpersonationLevel level, Int32 timeout)
   at System.Runtime.Remoting.Channels.Ipc.IpcClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
   at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.VisualStudio.TestTools.Execution.IResultSink.AddResult(TestMessage testMessage)
   at Microsoft.Moles.VsHost.Host.SafeResultSink.AddResult(TestMessage testMessage)
   at Microsoft.Moles.VsHost.RunResultSyncLogger.eventLogSource_LogHandler(LogEventArgs e)
   at Microsoft.ExtendedReflection.Logging.EventLog.LogUnfiltered(LogEventArgs args)
   at Microsoft.ExtendedReflection.Logging.EventLog.LogErrorFromException(Exception ex, String wikiTopic, String category, String message)
   at Microsoft.Moles.VsHost.Host.MolesHostAdapter.AsyncRunTests()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

When test is run to the end, no crash occurs. 测试运行到最后时,不会发生崩溃。 Already tried to reinstall .NET Framework and Moles, no success resolving this problem. 已经尝试重新安装.NET Framework和Moles,但没有成功解决此问题。 Any ideas what is causing/how to fix this issue? 任何想法导致/如何解决此问题? Proxy and IPC connections shown are very weird. 所示的代理和IPC连接非常奇怪。 Thanks in advance. 提前致谢。

在项目升级过程中解决了问题,最终淘汰了Moles并将其替换为Fakes。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 调试测试时 Moles 测试成功完成,但选择“运行测试”时 moles 主机崩溃 - Moles test completes successfully when debugging tests, but moles host crashes when selecting “run tests” 通过代码随机进行单元测试调试步骤 - Unit Test debugging steps randomly through the code 如何调试使用Microsoft Moles框架的单元测试 - How to debug unit tests that use Microsoft Moles framework 如何在不安装的情况下运行使用Microsoft Moles编写的单元测试? - How to run unit tests written with Microsoft Moles without installing it? 在编写单元测试时断言“什么都没发生” - Assert that “nothing happened” when writing unit test 单元测试应该通过失败 - Unit test is passing when it should fail 比较两个IList时单元测试失败 - Unit Test failing when comparing two ILists 调试停止后自动卸载WinRT App - Auto Uninstall WinRT App after Debugging Stopped 使用带有优化的单元测试代码的RemoteTestRunner时的无限循环 - Infinite loop when using a RemoteTestRunner with optimized unit test code 为什么在单元测试中实例化ListView时SelectedIndices和SelectedItems不起作用? - Why do SelectedIndices and SelectedItems not work when ListView is instantiated in unit test?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM