简体   繁体   English

调试测试时 Moles 测试成功完成,但选择“运行测试”时 moles 主机崩溃

[英]Moles test completes successfully when debugging tests, but moles host crashes when selecting “run tests”

I have an issue running some moles tests within Visual Studio 2010. Within a test fixture, I have 4 tests - which when I run them in Debug mode, they all work properly.我在 Visual Studio 2010 中运行一些 moles 测试时遇到问题。在测试夹具中,我有 4 个测试 - 当我在调试模式下运行它们时,它们都可以正常工作。

When I run them using "Run Tests" rather than "Debug Tests", one in particular fails and the following error is given:当我使用“运行测试”而不是“调试测试”运行它们时,特别失败并给出以下错误:

Problem signature:问题签名:

Problem Event Name: CLR20r3问题事件名称:CLR20r3

Problem Signature 01: microsoft.moles.vshost.x86.exe问题签名 01:microsoft.moles.vshost.x86.exe

Problem Signature 02: 0.94.0.0问题签名 02:0.94.0.0

Problem Signature 03: 4cc31915问题签名 03:4cc31915

Problem Signature 04: mscorlib问题签名 04:mscorlib

Problem Signature 05: 4.0.0.0问题签名 05:4.0.0.0

Problem Signature 06: 4d53693b问题签名 06:4d53693b

Problem Signature 07: 23d7问题签名 07: 23d7

Problem Signature 08: 33问题签名 08: 33

Problem Signature 09: System.AccessViolationException问题签名 09:System.AccessViolationException

OS Version: 6.1.7600.2.0.0.272.7操作系统版本:6.1.7600.2.0.0.272.7

Locale ID: 1033区域设置 ID:1033

Additional Information 1: 0a9e附加信息 1:0a9e

Additional Information 2: 0a9e372d3b4ad19135b953a78882e789附加信息 2:0a9e372d3b4ad19135b953a78882e789

Additional Information 3: 0a9e附加信息 3:0a9e

Additional Information 4: 0a9e372d3b4ad19135b953a78882e789附加信息 4:0a9e372d3b4ad19135b953a78882e789

All of the tests involve load types and create instances dynamically, although the that fails does some additional inspection on the type by examining an attribute on the class, de-serializing xml into an instance of a type, then using that as an argument to the constructor of the type.所有测试都涉及加载类型并动态创建实例,尽管失败通过检查 class 上的属性对类型进行一些额外检查,将 xml 反序列化为类型的实例,然后将其用作类型的构造函数。

Not sure why that should cause any specific issues, but that's the only thing I've been able to isolate.不知道为什么这会导致任何具体问题,但这是我唯一能够隔离的事情。

Any help would be greatly appreciated.任何帮助将不胜感激。

EDIT:编辑:

I initially provided the error thrown by the host, here's the error reported by the VS test runner:我最初提供了主机抛出的错误,这是VS测试运行器报告的错误:

The test adapter 'MolesAgentAdapter' threw an exception while running test 'Create_Returns_Configuration_When_Configured_Rule_Specifies_Configuration_Data'.测试适配器“MolesAgentAdapter”在运行测试“Create_Returns_Configuration_When_Configured_Rule_Specifies_Configuration_Data”时引发异常。 Failed to read from an IPC Port: The pipe has been ended.从 IPC 端口读取失败:pipe 已结束。

I have had the same problem many times over, but was eventually able to solve it by disabling the 'Test Impact' feature in the data and diagnostics section of the solution test run config file (*.testrunconfig)我已经多次遇到同样的问题,但最终能够通过禁用解决方案测试运行配置文件 (*.testrunconfig) 的数据和诊断部分中的“测试影响”功能来解决它

Just go to Test Settings > Data and Diagnostics > Test Impact and untick the little checkbox.只需 go 到测试设置 > 数据和诊断 > 测试影响并取消选中小复选框。

When it is on, I get the problem you describe, when it is off, everything works just fine.当它打开时,我得到了您描述的问题,当它关闭时,一切正常。 Maybe the PEX team will get this resolved in the next release (I hope)也许 PEX 团队会在下一个版本中解决这个问题(我希望)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM