为什么使用 NUnit / TestDriven.Net2.0 测试会崩溃?
我有一组运行良好的 TestFixtures。我在装置中添加了一个新的测试,但由于某种原因,我无法运行它。其他班级甚至同一班级的其他测试都运行良好。
- NUnit GUI / TestDriven 都崩溃
如果我从 NUnit GUI 运行,我收到此错误:
NUnit 已停止使用此消息
Description:
Stopped working
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: nunit.exe
Problem Signature 02: 2.5.3.9345
Problem Signature 03: 4b2334ce
Problem Signature 04: Engine
Problem Signature 05: 1.0.0.0
Problem Signature 06: 4b51c6fe
Problem Signature 07: ad
Problem Signature 08: 0
Problem Signature 09: System.StackOverflowException
OS Version: 6.0.6001.2.1.0.768.3
Locale ID: 2057
在 VS2008 内使用 TestDriven.Net 2.0,收到此错误:
TestDriven.Net 2.0已停止工作
Description:
Stopped working
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: processinvocation86.exe
Problem Signature 02: 3.0.2556.0
Problem Signature 03: 4af0254b
Problem Signature 04: Engine
Problem Signature 05: 1.0.0.0
Problem Signature 06: 4b51c6fe
Problem Signature 07: ad
Problem Signature 08: 0
Problem Signature 09: System.StackOverflowException
OS Version: 6.0.6001.2.1.0.768.3
Locale ID: 2057
I have a Set of TestFixtures running fine. I added a new Test into the fixture, but for some reason, I am not able to run it. Other tests in other classes and even in the same class run fine.
- Both NUnit GUI / TestDriven crash
If I run from NUnit GUI I get this error:
NUnit has stopped Working with this message
Description:
Stopped working
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: nunit.exe
Problem Signature 02: 2.5.3.9345
Problem Signature 03: 4b2334ce
Problem Signature 04: Engine
Problem Signature 05: 1.0.0.0
Problem Signature 06: 4b51c6fe
Problem Signature 07: ad
Problem Signature 08: 0
Problem Signature 09: System.StackOverflowException
OS Version: 6.0.6001.2.1.0.768.3
Locale ID: 2057
using TestDriven.Net 2.0 inside VS2008, get this error:
TestDriven.Net 2.0 has stopped working
Description:
Stopped working
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: processinvocation86.exe
Problem Signature 02: 3.0.2556.0
Problem Signature 03: 4af0254b
Problem Signature 04: Engine
Problem Signature 05: 1.0.0.0
Problem Signature 06: 4b51c6fe
Problem Signature 07: ad
Problem Signature 08: 0
Problem Signature 09: System.StackOverflowException
OS Version: 6.0.6001.2.1.0.768.3
Locale ID: 2057
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,很明显你正在导致堆栈溢出。 StackOverflowException 是一个致命异常,它会导致 CLR 崩溃 - 这就是您看到该问题的原因。
我建议您调试测试以找出堆栈溢出的原因。这通常是一个递归问题。例如,如果属性中有拼写错误:
这将导致堆栈溢出 - 但不小心编写的递归方法也会导致堆栈溢出。
Well, it seems fairly clear that you're causing a stack overflow. StackOverflowException is a fatal exception which will bring down the CLR - which is why you're seeing that problem.
I suggest you debug into the test to work out the cause of the stack overflow. It's typically a recursion issue. For example, if you have a typo in a property:
That will cause a stack overflow - but so can incautiously written recursive methods.