MSTest 似乎毫无原因地挂起

2024-01-16


从命令行运行 MSTest 测试在“等待运行/代理”时挂起,没有任何错误或超时。原因可能是“队列中没有运行”,但为什么会这样我不知道,因为exact同样的测试在另一台机器上运行得很好。


我们最近从在测试机器上评估 TeamCity 转向将其安装在我们的生产环境中。迁移所有构建配置后,我们的 MSTest 测试突然出现问题:没有一个可以运行。

在对我们能想到的一切进行调试之后,我们认为我们已经排除了与 TeamCity 相关的任何可能性。我们相信这与 MSTest 直接相关。作为重现问题的简单方法,我创建了一个测试解决方案MS测试测试(C# 4.0) 在 Visual Studio 中。

它有一个项目MS测试测试单一班级Class1:

namespace MSTestTest
{
    public static class Class1
    {
        public static string Foo()
        {
            return "Bar";
        }
    }
}

它还有另一个项目MS测试测试测试使用单个 MSTest 测试类单元测试1:

using MSTestTest;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace MSTestTestTest
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            Assert.AreEqual("Bar", Class1.Foo());
        }
    }
}

解决方案已编译,我复制了它的两个 DLL(MSTestTest.dll and MSTestTest.dll)到我们的旧测试服务器和新生产服务器。在两台服务器上,我都编辑了 MSTest.exe.config 文件以将详细日志记录信息写入C:\Temp\MSTestTrace.log (如此处所述 http://my2centsontfs.blogspot.no/2012/03/enabling-logging-on-mstestexe.html).

然后,我在测试服务器和生产服务器上从命令行运行测试,如下所示:

mstest /testcontainer:MSTestTestTest.dll /resultsfile:results.trx

在测试服务器上我立即得到成功的测试结果:

C:\temp\MSTestTestTest>mstest /testcontainer:MSTestTestTest.dll /resultsfile:results.trx
Microsoft (R) Test Execution Command Line Tool Version 10.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.

Loading MSTestTestTest.dll...
Starting execution...

Results               Top Level Tests
-------               ---------------
Passed                MSTestTestTest.UnitTest1.TestMethod1
1/1 test(s) Passed

Summary
-------
Test Run Completed.
  Passed  1
  ---------
  Total   1
Results file:  C:\temp\MSTestTestTest\results.trx
Test Settings: Default Test Settings

然而,在生产服务器上,我得到的只是:

C:\Temp\MSTestTestTest>mstest /testcontainer:MSTestTestTest.dll /resultsfile:results.trx
Microsoft (R) Test Execution Command Line Tool Version 10.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.

Loading MSTestTestTest.dll...
Starting execution...

我已经让服务器运行了几个小时,但没有任何反应。没有超时,没有错误,什么都没有。此时我完全不知道该从哪里继续。

这是测试服务器上的跟踪日志的摘录(完整日志可以在这里看到 http://pastebin.com/bSWEYeSg(来自不同但相同的运行)):

15:02:39.525, TestAgentProcessReady: total # of execution agents=1.
15:02:39.525, ControllerExecution.TestAgentProcessReady: areAllAgentProcessesReady=True.
15:02:39.525, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Controller.ReceivedTestMessageWrapper>(ControllerExecution.TestMessageReceiver)+ExternalJob.ProcessJob: successfully invoked job processor for job 'ReceivedTestMessageWrapper for test message 'Microsoft.VisualStudio.TestTools.Execution.TestAgentProcessStartedMessage' from agent 'TRUTVBYGG01''
15:02:39.634, ControllerObject: RunQueueThread waiting for runs/agents...
15:02:39.744, AgentProcessManager.StartTestAgentRun_DoWork: tests were queued to test agents.
15:02:39.744, ControllerExecution.SyncAllExecutionAgentsReady: finished waiting on m_agentProcessesInitialized: signaledIndex=0
15:02:39.744, StateMachine(RunState): SetNextState Started called
15:02:39.744, StateMachine(RunState): In state Started. Waiting for state change...
15:02:39.744, StateMachine(RunState): Exit wait for state change, current state is Started.
15:02:39.744, StateMachine(RunState): calling state handler for Started
15:02:39.744, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: invoking special job checker for job 'TRUTVBYGG01: Run {9363144a-38a7-4ee1-a920-1e1a3584859b}: Started'
15:02:39.744, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: successfully invoked special job checker for job 'TRUTVBYGG01: Run {9363144a-38a7-4ee1-a920-1e1a3584859b}: Started'
15:02:39.744, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: isSpecial = False
15:02:39.744, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: Queuing job 'Type Microsoft.VisualStudio.TestTools.Common.RunStateEvent: TRUTVBYGG01: Run {9363144a-38a7-4ee1-a920-1e1a3584859b}: Started'
15:02:39.744, ControllerObject: RunStartedHandler called for run 9363144a-38a7-4ee1-a920-1e1a3584859b
15:02:39.744, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry>(ControllerObject.RunQueueMessageProcessor).TryEnqueueJob: Queuing job 'Type Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry: Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry'
15:02:39.744, StateMachine(RunState): SetNextState Running called
15:02:39.744, StateMachine(RunState): In state Running. Waiting for state change...
15:02:39.744, StateMachine(RunState): Exit wait for state change, current state is Running.
15:02:39.744, StateMachine(RunState): calling state handler for Running
15:02:39.744, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: invoking special job checker for job 'TRUTVBYGG01: Run {9363144a-38a7-4ee1-a920-1e1a3584859b}: Running'
15:02:39.744, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: successfully invoked special job checker for job 'TRUTVBYGG01: Run {9363144a-38a7-4ee1-a920-1e1a3584859b}: Running'
15:02:39.744, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: isSpecial = False
15:02:39.744, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: Queuing job 'Type Microsoft.VisualStudio.TestTools.Common.RunStateEvent: TRUTVBYGG01: Run {9363144a-38a7-4ee1-a920-1e1a3584859b}: Running'
15:02:39.744, StateMachine(RunState): In state Running. Waiting for state change...
15:02:39.744, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender)+ExternalJob.ProcessJob: invoking job processor for job 'TRUTVBYGG01: Run {9363144a-38a7-4ee1-a920-1e1a3584859b}: Started'
15:02:39.744, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver).TryEnqueueJob: invoking special job checker for job 'Microsoft.VisualStudio.TestTools.Common.TestMessageBulk'
15:02:39.744, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver).TryEnqueueJob: successfully invoked special job checker for job 'Microsoft.VisualStudio.TestTools.Common.TestMessageBulk'
15:02:39.744, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver).TryEnqueueJob: isSpecial = False
15:02:39.744, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver).TryEnqueueJob: Queuing job 'Type Microsoft.VisualStudio.TestTools.Common.TestMessageBulk: Microsoft.VisualStudio.TestTools.Common.TestMessageBulk'
15:02:39.744, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender)+ExternalJob.ProcessJob: successfully invoked job processor for job 'TRUTVBYGG01: Run {9363144a-38a7-4ee1-a920-1e1a3584859b}: Started'
15:02:39.744, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry>(ControllerObject.RunQueueMessageProcessor)+ExternalJob.ProcessJob: invoking job processor for job 'Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry'
15:02:39.744, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry>(ControllerObject.RunQueueMessageProcessor)+ExternalJob.ProcessJob: successfully invoked job processor for job 'Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry'
15:02:39.744, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver)+ExternalJob.ProcessJob: invoking job processor for job 'Microsoft.VisualStudio.TestTools.Common.TestMessageBulk'
15:02:39.744, LocalRunMessageListener.OnProcessReceivedTestMessage: Handling message 'TRUTVBYGG01: Run {9363144a-38a7-4ee1-a920-1e1a3584859b}: Started'
15:02:39.744, LocalRunMessageListener: RestartTimer
15:02:39.744, LocalRunMessageListener.OnProcessReceivedTestMessage: Handling message 'TRUTVBYGG01: Run {9363144a-38a7-4ee1-a920-1e1a3584859b}: Running'
15:02:39.744, LocalRunMessageListener: RestartTimer
15:02:39.744, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver)+ExternalJob.ProcessJob: successfully invoked job processor for job 'Microsoft.VisualStudio.TestTools.Common.TestMessageBulk'
15:02:39.900, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Controller.ReceivedTestMessageWrapper>(ControllerExecution.TestMessageReceiver).TryEnqueueJob: invoking special job checker for job 'ReceivedTestMessageWrapper for test message 'Run {9363144a-38a7-4ee1-a920-1e1a3584859b}, Test {854d1b23-760d-4e32-a6c7-91b74b5f2409}: Started' from agent 'TRUTVBYGG01''
15:02:39.900, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Controller.ReceivedTestMessageWrapper>(ControllerExecution.TestMessageReceiver).TryEnqueueJob: successfully invoked special job checker for job 'ReceivedTestMessageWrapper for test message 'Run {9363144a-38a7-4ee1-a920-1e1a3584859b}, Test {854d1b23-760d-4e32-a6c7-91b74b5f2409}: Started' from agent 'TRUTVBYGG01''
15:02:39.900, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Controller.ReceivedTestMessageWrapper>(ControllerExecution.TestMessageReceiver).TryEnqueueJob: isSpecial = False
15:02:39.900, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Controller.ReceivedTestMessageWrapper>(ControllerExecution.TestMessageReceiver).TryEnqueueJob: Queuing job 'Type Microsoft.VisualStudio.TestTools.Controller.ReceivedTestMessageWrapper: ReceivedTestMessageWrapper for test message 'Run {9363144a-38a7-4ee1-a920-1e1a3584859b}, Test {854d1b23-760d-4e32-a6c7-91b74b5f2409}: Started' from agent 'TRUTVBYGG01''
15:02:39.900, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Controller.ReceivedTestMessageWrapper>(ControllerExecution.TestMessageReceiver)+ExternalJob.ProcessJob: invoking job processor for job 'ReceivedTestMessageWrapper for test message 'Run {9363144a-38a7-4ee1-a920-1e1a3584859b}, Test {854d1b23-760d-4e32-a6c7-91b74b5f2409}: Started' from agent 'TRUTVBYGG01''
15:02:39.900, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: invoking special job checker for job 'Run {9363144a-38a7-4ee1-a920-1e1a3584859b}, Test {854d1b23-760d-4e32-a6c7-91b74b5f2409}: Started'
15:02:39.900, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: successfully invoked special job checker for job 'Run {9363144a-38a7-4ee1-a920-1e1a3584859b}, Test {854d1b23-760d-4e32-a6c7-91b74b5f2409}: Started'
15:02:39.900, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: isSpecial = False
15:02:39.900, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: Queuing job 'Type Microsoft.VisualStudio.TestTools.Common.TestStateEvent: Run {9363144a-38a7-4ee1-a920-1e1a3584859b}, Test {854d1b23-760d-4e32-a6c7-91b74b5f2409}: Started'
15:02:39.900, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Controller.ReceivedTestMessageWrapper>(ControllerExecution.TestMessageReceiver)+ExternalJob.ProcessJob: successfully invoked job processor for job 'ReceivedTestMessageWrapper for test message 'Run {9363144a-38a7-4ee1-a920-1e1a3584859b}, Test {854d1b23-760d-4e32-a6c7-91b74b5f2409}: Started' from agent 'TRUTVBYGG01''
15:02:39.900, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender)+ExternalJob.ProcessJob: invoking job processor for job 'Run {9363144a-38a7-4ee1-a920-1e1a3584859b}, Test {854d1b23-760d-4e32-a6c7-91b74b5f2409}: Started'
15:02:39.900, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver).TryEnqueueJob: invoking special job checker for job 'Run {9363144a-38a7-4ee1-a920-1e1a3584859b}, Test {854d1b23-760d-4e32-a6c7-91b74b5f2409}: Started'

这是生产服务器的类似摘录(完整日志可以在这里看到 http://pastebin.com/K26uv414(来自不同但相同的运行)),显示事情开始挂起的位置:

16:33:50.260, TestAgentProcessReady: total # of execution agents=1.
16:33:50.260, ControllerExecution.TestAgentProcessReady: areAllAgentProcessesReady=True.
16:33:50.260, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Controller.ReceivedTestMessageWrapper>(ControllerExecution.TestMessageReceiver)+ExternalJob.ProcessJob: successfully invoked job processor for job 'ReceivedTestMessageWrapper for test message 'Microsoft.VisualStudio.TestTools.Execution.TestAgentProcessStartedMessage' from agent 'TRAPPUTVTCP01''
16:33:50.292, AgentProcessManager.StartTestAgentRun_DoWork: tests were queued to test agents.
16:33:50.292, ControllerExecution.SyncAllExecutionAgentsReady: finished waiting on m_agentProcessesInitialized: signaledIndex=0
16:33:50.292, StateMachine(RunState): SetNextState Started called
16:33:50.292, StateMachine(RunState): In state Started. Waiting for state change...
16:33:50.292, StateMachine(RunState): Exit wait for state change, current state is Started.
16:33:50.292, StateMachine(RunState): calling state handler for Started
16:33:50.292, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: invoking special job checker for job 'TRAPPUTVTCP01: Run {453f4093-9409-40f3-9651-34caa1b8c92a}: Started'
16:33:50.292, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: successfully invoked special job checker for job 'TRAPPUTVTCP01: Run {453f4093-9409-40f3-9651-34caa1b8c92a}: Started'
16:33:50.292, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: isSpecial = False
16:33:50.292, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: Queuing job 'Type Microsoft.VisualStudio.TestTools.Common.RunStateEvent: TRAPPUTVTCP01: Run {453f4093-9409-40f3-9651-34caa1b8c92a}: Started'
16:33:50.292, ControllerObject: RunStartedHandler called for run 453f4093-9409-40f3-9651-34caa1b8c92a
16:33:50.292, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry>(ControllerObject.RunQueueMessageProcessor).TryEnqueueJob: Queuing job 'Type Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry: Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry'
16:33:50.292, StateMachine(RunState): SetNextState Running called
16:33:50.292, StateMachine(RunState): In state Running. Waiting for state change...
16:33:50.292, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry>(ControllerObject.RunQueueMessageProcessor)+ExternalJob.ProcessJob: invoking job processor for job 'Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry'
16:33:50.292, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry>(ControllerObject.RunQueueMessageProcessor)+ExternalJob.ProcessJob: successfully invoked job processor for job 'Microsoft.VisualStudio.TestTools.Execution.ControllerQueueEntry'
16:33:50.292, StateMachine(RunState): Exit wait for state change, current state is Running.
16:33:50.292, StateMachine(RunState): calling state handler for Running
16:33:50.292, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: invoking special job checker for job 'TRAPPUTVTCP01: Run {453f4093-9409-40f3-9651-34caa1b8c92a}: Running'
16:33:50.292, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: successfully invoked special job checker for job 'TRAPPUTVTCP01: Run {453f4093-9409-40f3-9651-34caa1b8c92a}: Running'
16:33:50.292, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: isSpecial = False
16:33:50.292, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender).TryEnqueueJob: Queuing job 'Type Microsoft.VisualStudio.TestTools.Common.RunStateEvent: TRAPPUTVTCP01: Run {453f4093-9409-40f3-9651-34caa1b8c92a}: Running'
16:33:50.292, StateMachine(RunState): In state Running. Waiting for state change...
16:33:50.292, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender)+ExternalJob.ProcessJob: invoking job processor for job 'TRAPPUTVTCP01: Run {453f4093-9409-40f3-9651-34caa1b8c92a}: Started'
16:33:50.292, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver).TryEnqueueJob: invoking special job checker for job 'Microsoft.VisualStudio.TestTools.Common.TestMessageBulk'
16:33:50.307, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver).TryEnqueueJob: successfully invoked special job checker for job 'Microsoft.VisualStudio.TestTools.Common.TestMessageBulk'
16:33:50.307, BackgroundSpecialJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver).TryEnqueueJob: isSpecial = False
16:33:50.307, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver).TryEnqueueJob: Queuing job 'Type Microsoft.VisualStudio.TestTools.Common.TestMessageBulk: Microsoft.VisualStudio.TestTools.Common.TestMessageBulk'
16:33:50.307, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(ControllerExecution.TestMessageSender)+ExternalJob.ProcessJob: successfully invoked job processor for job 'TRAPPUTVTCP01: Run {453f4093-9409-40f3-9651-34caa1b8c92a}: Started'
16:33:50.307, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver)+ExternalJob.ProcessJob: invoking job processor for job 'Microsoft.VisualStudio.TestTools.Common.TestMessageBulk'
16:33:50.307, LocalRunMessageListener.OnProcessReceivedTestMessage: Handling message 'TRAPPUTVTCP01: Run {453f4093-9409-40f3-9651-34caa1b8c92a}: Started'
16:33:50.307, LocalRunMessageListener: RestartTimer
16:33:50.307, LocalRunMessageListener.OnProcessReceivedTestMessage: Handling message 'TRAPPUTVTCP01: Run {453f4093-9409-40f3-9651-34caa1b8c92a}: Running'
16:33:50.307, LocalRunMessageListener: RestartTimer
16:33:50.307, BackgroundJobProcessor<Microsoft.VisualStudio.TestTools.Common.TestMessage>(LocalRunMessageListener.TestMessageReceiver)+ExternalJob.ProcessJob: successfully invoked job processor for job 'Microsoft.VisualStudio.TestTools.Common.TestMessageBulk'
16:33:50.401, ControllerObject: RunQueueThread there are no runs in the queue.
16:33:50.510, ControllerObject: RunQueueThread waiting for runs/agents...
16:34:10.291, LocalRunMessageListener: RestartTimer
16:34:10.291, ControllerExecution: Sent heartbeat to listeners
16:34:30.321, LocalRunMessageListener: RestartTimer
16:34:30.321, ControllerExecution: Sent heartbeat to listeners
16:34:50.352, LocalRunMessageListener: RestartTimer
16:34:50.352, ControllerExecution: Sent heartbeat to listeners
16:35:10.382, LocalRunMessageListener: RestartTimer
16:35:10.382, ControllerExecution: Sent heartbeat to listeners
16:35:30.412, LocalRunMessageListener: RestartTimer
16:35:30.412, ControllerExecution: Sent heartbeat to listeners
16:35:50.443, LocalRunMessageListener: RestartTimer

我还尝试从以管理员身份运行 MSTest 的地方运行命令提示符,但这似乎没有任何区别。

任何关于我下一步应该做什么的建议都将非常受欢迎!


该问题是由于并行安装 Visual Studio 2010 和 Visual Studio 2012 时 MSTest 出现错误所致。解决方案是安装 Visual Studio 2010 Service Pack 1。

我通过查看来意识到这一点Windows 日志 > 应用程序 in the 事件查看器。在那里我发现了一个来自源的错误VSTA代理进程(我一直在查看的任何 MSTest 跟踪日志中都没有出现过):

(QTAgent32.exe, PID 6912, Thread 9) AgentObject.OnBackgroundSendTestMessage: Connection to controller was lost.
System.Runtime.Remoting.RemotingException:
The argument type 'Run {b816a0d9-50f3-490a-96b8-479555466167}, Test {8a2710b4-3cf9-441c-bd5c-0efb0601e059}: Started' cannot be converted into parameter type 'Microsoft.VisualStudio.TestTools.Common.TestMessage'.
---> System.InvalidCastException: Object must implement IConvertible.
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at System.Runtime.Remoting.Messaging.Message.CoerceArg(Object value, Type pt)
   --- End of inner exception stack trace ---

谷歌搜索这个例外然后让我这篇文章解释了 VS 2010/2012 问题 http://blogs.msdn.com/b/aseemb/archive/2012/09/08/not-able-to-run-unit-tests-when-visual-studio-2010-and-visual-studio-2012-are-installed-side-by-side.aspx.

还值得一提的是,我必须安装 Microsoft Office Developer Tools在我能够安装VS2010 SP1之前 https://stackoverflow.com/questions/5296830/microsoft-visual-studio-2010-service-pack-1-installation.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

MSTest 似乎毫无原因地挂起 的相关文章

随机推荐

  • Jsch 和 Maven 出了什么问题?

    我尝试将 Jsch 0 1 44 与 Maven 一起使用 我的 pom xml 中有以下依赖项
  • FrameLayout 中的 Android 中心视图不起作用

    我有一个 FrameLayout 其中有 2 个控件 自定义视图 在其上绘制图像和一些文本 带有文本的文本视图 我想将两者都集中在 FrameLayout 中 但我无法做到这一点 Texview 居中得很好 当我使其可见时 我的自定义视图仍
  • 在 AWS Sagemaker pytorch-1.10-cpu-py38 应用程序上使用 htop 出现段错误

    我正在尝试在 Pytorch 1 10 Python 3 8 CPU 优化的 AWS Sagemaker 容器中启动 htop 命令 这在我迄今为止使用过的其他图像中工作得很好 但在这一个图像中 该命令因段错误而失败 htop htop o
  • Python pandas 绘制如果孪生两个 y 轴则移动 x 轴

    我有一个包含 3 列的数据框 其中一列是 groupby 列 另外两列是带有值的 普通 列 我还想生成箱线图和条形图 在条形图上 我想可视化每个组元素出现的次数 让我的示例代码更详细地告诉这个数据框 li str one two three
  • 使用katex,“&”对齐符号显示为“amp;”

    我正在使用 katex 来渲染数学 https github com Khan KaTeX https github com Khan KaTeX 一般来说 为了让它工作 我链接到文件katex min js and katex min c
  • 地图 API - 街道上的标记

    在 Maps API 中 有没有办法将标记捕捉到街道 通常 如果您想按地址 而不是经纬度 设置标记 则标记会设置在建筑物内的某个位置 就我而言 如果您有例如一个有几家商店的大型购物中心 我宁愿在街上立一个标记 我正在使用地图 API v3
  • AssertionError:您需要在 UserProfile.Meta 中传递有效的 Django 模型,收到“无”

    我使用 AbstractBaseUser 自定义用户模型将 Django 模型添加到 graphql api 管理员工作正常 只是在尝试访问 graphql api 时出现错误 您需要在 UserProfile Meta 中传递有效的 Dj
  • MySQL 整数字段在 PHP 中以字符串形式返回

    我在 MySQL 数据库中有一个表字段 userid INT 11 所以我用这个查询将它调用到我的页面 SELECT userid FROM DB WHERE name john 然后为了处理结果我这样做 row result gt fet
  • Here Maps Routing API V8 - 多个路径点

    我对 Here Maps Routing API v8 非常陌生 我已经尝试过这里提供的示例 https developer here com documentation maps 3 1 15 1 dev guide topics rou
  • 在 C# 中使用 Directory.GetFiles 和正则表达式?

    我有这个代码 string files Directory GetFiles path SearchOption AllDirectories 我想要的是仅返回不以以下内容开头的文件p and t 并具有扩展名 png 或 jpg 或 gi
  • .External.graphics R 中的错​​误

    我使用下面的函数从 48 列 X 32 行的矩阵创建热图 heatmap 2 all data Rowv FALSE Colv FALSE trace none main All data col colorRampPalette c gr
  • 如何在Authorize.net中查看交易已结算/未结算?

    如何在authorize net中查找用户进行的交易是否已结算或未结算 我正在使用AIM 我想通过编码 当交易完成时 我找不到交易状态 但我想知道它是已结算还是未结算的交易 提前致谢 您无法通过编码获取此信息 因为 Authorize Ne
  • 如何计算具有重复元素的列表的排列(排列)

    我有一个包含重复元素的列表 即orig 1 1 1 2 2 3 我想创建一个精神错乱 https en wikipedia org wiki Derangement b f orig 这样对于每个位置值b与值不同orig b i orig
  • 不安全的 C 函数及其替换

    如果我错了 请纠正我 我在网站上进行了研究 但找不到针对此问题的任何综合帖子 C 中有许多不安全函数可能导致缓冲区溢出 并且有安全函数来替代它们 我有几个 gets 替换为 fgets sprintf 替换为 strcat 替换为 strc
  • 使用 AngularJS 的数据表中的单元格按钮

    我正在使用 angularjs 构建一个网站 并从网络服务获取数据 我需要将该数据填充到数据表中 并为每一行创建一个编辑按钮 经过一番调查我想出了this http jsfiddle net ultrasardine 7kLFU 485 问
  • 网站未在某些页面加载 css 文件

    我正在构建的网站不会加载某些页面的任何 css javascript 文件 有问题的页面是 Markdown 帖子文件 我正在使用 Jekyll 来构建该网站 链接在这里 http joshhornby co uk http joshhor
  • 如何将数组转换为元组?

    我有一个Array Any 来自 Java JPA 包含 在本例中为两个 但考虑任意少量 不同类型的事物 我想将它们表示为元组 我有一些快速而肮脏的转换代码 并且想知道如何改进它并使其更加通用 val pair query getSingl
  • 如何在jvm上运行scala字节码?

    如何在 jvm 上运行编译后的 scala 代码 当我尝试以下命令时 java cp scala library jar cp bin com mcmc5 Main 我收到以下错误 Exception in thread main java
  • 将多个正则表达式连接成一个正则表达式

    对于文本文件 我想匹配以 BEAM 和 FILE PATH 开头的字符串 我会用 BEAM FILE PATH 如果我要单独匹配它们 但现在我必须将这两个匹配模式连接成一个模式 关于如何做到这一点有什么想法吗 竖线 竖线字符通常用正则表达式
  • MSTest 似乎毫无原因地挂起

    从命令行运行 MSTest 测试在 等待运行 代理 时挂起 没有任何错误或超时 原因可能是 队列中没有运行 但为什么会这样我不知道 因为exact同样的测试在另一台机器上运行得很好 我们最近从在测试机器上评估 TeamCity 转向将其安装