6

<TLDR>
コマンド ラインから MSTest テストを実行すると、「実行/エージェントの待機中」にエラーやタイムアウトが発生せずにハングします。その理由は「キューに実行がない」ためかもしれませんが、まったく同じテストが別のマシンで正常に実行されるため、これがなぜなのかわかりません。
</TLDR>


最近、TeamCity をテスト マシンで評価することから、運用環境にインストールすることに移行しました。すべてのビルド構成を移行した後、MSTest テストで突然問題が発生しました。何も実行されませんでした。

考えられるすべての方法でデバッグした後、TeamCity との関係を除外したと思います。私たちは、これが MSTest に直接関係していると信じています。問題を再現する簡単な方法として、Visual Studio でテスト ソリューションMSTestTest (C# 4.0) を作成しました。

これには、1つのクラスClass1を持つ 1 つのプロジェクトMSTestTestがあります。

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

単一の MSTest テスト クラスUnitTest1を持つ別のプロジェクトMSTestTestTestがあります。

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

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

ソリューションがコンパイルされ、その 2 つの DLL ( MSTestTest.dllMSTestTestTest.dll ) を古いテスト サーバーと新しい運用サーバーにコピーします。両方のサーバーで、詳細なログ情報をC:\Temp\MSTestTrace.logに書き込むように MSTest.exe.config ファイルを編集しました(ここで説明)。

テスト サーバーと運用サーバーの両方で、次のようにコマンド ラインからテストを実行します。

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...

サーバーを何時間も稼働させたままにしましたが、何も起こりません。タイムアウトなし、エラーなし、何もありません。この時点で、どこで続行するかについて完全に行き詰まっています。

テスト サーバーのトレース ログからの抜粋を次に示します (完全なログはここで確認できます (別の同じ実行から))。

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'

そして、これは実稼働サーバーからの同様の抜粋です (完全なログはここで(別の、しかし同一の実行から)見ることができます)、ハングし始める場所を示しています:

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 を管理者として実行している場所からコマンド プロンプトを実行しようとしましたが、違いはないようです。

私の次のステップがどうあるべきかについての提案は大歓迎です!

4

2 に答える 2

19

この問題は、Visual Studio 2010 と Visual Studio 2012 を並べてインストールした場合の MSTest のバグが原因です。解決策は、Visual Studio 2010 の Service Pack 1 をインストールすることです。

Event ViewerのWindows Logs > Applicationsを見て、これに気づきました。そこで、ソースVSTTAgentProcessからのエラーを見つけました(調べていた 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 の問題を説明するこの投稿にたどり着きました。

VS2010 SP1 をインストールする前に、 Microsoft Office Developer Tools をインストールする必要があったことにも言及する価値があります。

于 2013-05-06T08:05:39.043 に答える