NUnit CPU 使用率很高 - 如何解决?
在许多不相关的项目中,即使我没有运行测试,NUnit 的 CPU 使用率通常也达到 50% 左右。 从我读到的其他信息来看,这应该更多地与我的代码有关,而不是与 Nunit 有关。
有谁知道如何隔离代码中导致此问题的问题并修复它们?
谢谢
On numerous unrelated, projects the CPU usage of NUnit has often ended up being about 50% even when I'm not running my tests. From other information I've read this is supposedly more to do with my code than Nunit.
Does anyone know how I can isolate the problems in my code that will be causing this and fix them?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到了同样的问题,而且它似乎一直只影响一个进行集成测试的测试项目(调用 Web 服务、通过 HTTP 检查内容等)。 我非常小心地处理网络对象(使用
using(...){ }
),所以我不太明白为什么 NUnit 应该在测试后继续使用 90% CPU 天测试完成后,所有使用过的物体都应该被处理掉。真正奇怪的是,在运行测试时,NUnit 使用的 CPU 不超过 10%-50%。 直到测试完成后,CPU使用率才开始飙升,并永远保持在80%-100%。 真的很奇怪。 重新加载或关闭测试项目(文件>关闭)也没有帮助。 NUnit 本身需要关闭。
I have the same problem and it seems to be rather consistently affecting only one test project doing integration testing (calling web services, checking stuff over HTTP, etc). I'm very careful to dispose of networked objects (with
using(...){ }
), so I don't quite understand why NUnit should continue to use 90% CPU days after the test is done with and all objects in use by the test should be disposed of.The really strange thing is that while running the test, NUnit uses no more than 10%-50% CPU. It's only after the test has completed that CPU usage surges and stays constantly at 80%-100% forever. It's really strange. Reloading or closing the test project (File > Close) doesn't help either. NUnit itself needs to be closed.