[英]How can I stop the Visual Studio Test Runner when a test hangs
When a test hangs in a loop, the small green progress bar in the test runner does not proceed, but there is no way to stop the test run.当测试在循环中挂起时,测试运行器中的绿色小进度条不会继续,但无法停止测试运行。 Or is there?或者有吗?
VS 2013对比 2013
Edit: This occured when using the XUnit TestRunner .编辑:这发生在使用XUnit TestRunner时。 The Cancel button simply did not show up.取消按钮根本没有出现。 After testing various test runners in a new solution, it turned out, that it works with all of them.在新解决方案中测试了各种测试运行程序后,结果证明它可以与所有这些运行程序一起使用。 Finally it also worked with my original solution.最后它也适用于我原来的解决方案。 So there was some anomaly in the state of my VS environment that caused cancel to disapper.因此,我的 VS 环境状态出现了一些异常,导致取消消失。
很抱歉唤醒了一个旧线程:) 只是想在这里分享我的解决方案,我在 VS 2015 上遇到了同样的问题。搜索输入下方有一些文本,就在取消应该出现的位置(看看@Codeman 打印屏幕) ,文本实际上是关于如何为测试设置构建的一些描述,文本是几行,最后你有“不再显示这个”只需按下它然后出现取消按钮:) 很奇怪错误,对不起,我没有这个的一些打印屏幕希望它可以帮助某人
VS2015. VS2015。 If the hanging tests are executables instead of DLLs you need to kill those tests in the task manager.如果挂起的测试是可执行文件而不是 DLL,则需要在任务管理器中终止这些测试。 You need to close the Test Explorer Window to prevent automatic running.您需要关闭测试资源管理器窗口以防止自动运行。 While the tests are running/hanging you will not be able to compile the according project.在测试运行/挂起时,您将无法编译相应的项目。
For me the solution was to go to Task Manager, locate chromedriver and end the task.对我来说,解决方案是转到任务管理器,找到 chromedriver 并结束任务。 Visual Studio 2022 Professional version 17.2.3. Visual Studio 2022 专业版 17.2.3。
I have found the solution to this issue.我已经找到了解决这个问题的方法。 To stop the run after cancel is pressed, just set the 'Terminate process on cancel' option to True.要在按下取消后停止运行,只需将“取消时终止进程”选项设置为 True。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.