locked
Unit test hangs on RTM visual Studio 2010 windows 7 64 RRS feed

  • Question

  • Hi I have a 64bit Windows 7 machine with visual studio 2010 Installed.

    I can't run any unit tests as it hangs  all the time.

    the Event viewer shows the follwing error message.

     

     

    (QTAgent32.exe, PID 4976, Thread 9) AgentObject.OnBackgroundSendTestMessage: Connection to controller was lost. System.Runtime.Remoting.RemotingException: The argument type 'Run {220bce81-71cb-4f15-be69-ffe88e09579f}, Test {42b6a60b-13a5-4b55-8d87-14566ad41d67}: 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 --- Server stack trace: at System.Runtime.Remoting.Messaging.Message.CoerceArg(Object value, Type pt) at System.Runtime.Remoting.Messaging.Message.CoerceArgs(MethodBase mb, Object[] args, ParameterInfo[] pi) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.VisualStudio.TestTools.Controller.IControllerCallback.AgentEvent(String agentName, TestMessage message) at Microsoft.VisualStudio.TestTools.Agent.AgentObject.<>c__DisplayClass14.<OnSendTestMessage>b__12() at Microsoft.VisualStudio.TestTools.Execution.ExecutionUtilities.InvokeController(Action invokeController, String caller, Boolean& connectionLost)

     

    I've unisntalled VS2010 like 5 times don;t really know what's going on.
     

     


    Everything can be found if you look
    Wednesday, August 4, 2010 6:28 AM

Answers

  • Hello,

    You can try the following steps to see if they help:

    a)     Try to run devenv /ResetSettings (in command prompt) to eliminate the related potential settings problem.

    b)     Try disabling Add-ins (e.g. “Tools” | “Add-in Manager”) or run “devenv.exe /SafeMode”.This can eliminate the possibility that third party Add-ins or packages are causing problems. (For more detailed VS command line switches information, see: http://msdn2.microsoft.com/en-us/library/xee0c8y7.aspx )

    c)     Try creating a new project. Sometimes corrupted project settings can cause problems. These are project specific.

    d)     Try to reboot the operating system to safe mode. This can help to isolate whether any other applications are interfering with Visual Studio. Note that some features (like IIS) are not available under safe mode. Please check whether this can be applied or not. In addition to safe mode, we can also try “clean boot”: How to configure Windows XP to start in a "clean boot" state http://support.microsoft.com/kb/310353 .

    e)      Try to create a new user account. This can help isolate user profile corruption related causes.

    If they do not help, try running "devenv /setup, devenv /resetskippkgs, devenv /resetuserdata" in command prompt.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Thursday, August 5, 2010 7:08 AM
    Moderator

All replies

  • Hello,

    You can try the following steps to see if they help:

    a)     Try to run devenv /ResetSettings (in command prompt) to eliminate the related potential settings problem.

    b)     Try disabling Add-ins (e.g. “Tools” | “Add-in Manager”) or run “devenv.exe /SafeMode”.This can eliminate the possibility that third party Add-ins or packages are causing problems. (For more detailed VS command line switches information, see: http://msdn2.microsoft.com/en-us/library/xee0c8y7.aspx )

    c)     Try creating a new project. Sometimes corrupted project settings can cause problems. These are project specific.

    d)     Try to reboot the operating system to safe mode. This can help to isolate whether any other applications are interfering with Visual Studio. Note that some features (like IIS) are not available under safe mode. Please check whether this can be applied or not. In addition to safe mode, we can also try “clean boot”: How to configure Windows XP to start in a "clean boot" state http://support.microsoft.com/kb/310353 .

    e)      Try to create a new user account. This can help isolate user profile corruption related causes.

    If they do not help, try running "devenv /setup, devenv /resetskippkgs, devenv /resetuserdata" in command prompt.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Thursday, August 5, 2010 7:08 AM
    Moderator
  • I uninstalled every extension to no avail.

    Then I ran  "devenv /setup, devenv /resetskippkgs, devenv /resetuserdata" in command prompt to no avail (although every one of the 3 commands worked).

    Then I tried a completely different solution - I have 2000+ tests in this solution and VS2010 will only run 18 of them, but it runs them immediately.

    On my laptop, I checked-out the first project and I can run the unit tests for the first project immediately without any problems.

    SO!

    Because it works fine on my laptop, and VS2010 worked fine with other projects on my desktop, then there was an easy solution.  I blew away the project on my desktop, pulled it completely from source control and it works beautifully.

    Robert

     



    Thursday, August 18, 2011 2:30 AM
  • I was able to work-around this issue by deleting the bin and obj folders as well as all .suo files for the .sln.
    • Proposed as answer by Klaus_R Wednesday, October 26, 2011 7:13 AM
    Wednesday, August 24, 2011 8:37 PM
  • In my scenario, a class I was using threw an Exception, but the unit test just hung and did not finish with a failure indication as expected.

    If I debug the unit test, I see the following in the Output window:

    The thread 'Agent: adapter run thread for test 'MyUnitTestName' with id '7d0af290-7207-417c-97b7-4b61ed7488d9'' (0x3b4) has exited with code 0 (0x0).
    The thread 'Agent: test queue thread' (0x2b90) has exited with code 0 (0x0).
    The thread 'Agent: state execution thread for test 'MyUnitTestName' with id '7d0af290-7207-417c-97b7-4b61ed7488d9'' (0x1694) has exited with code 0 (0x0).
    E, 13772, 17, 2011/08/24, 16:44:38.699, MYHOSTNAME\QTAgent32.exe, AgentObject.OnBackgroundSendTestMessage: Exception occurred while calling into the controller. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

    Server stack trace:
       at System.Text.StringBuilder.ToString()
       at System.IO.BinaryReader.ReadString()
       at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectString(BinaryHeaderEnum binaryHeaderEnum)
       at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
       at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
       at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
       at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel securityLevel)
       at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.VisualStudio.TestTools.Controller.IControllerCallback.AgentEvent(String agentName, TestMessage message)
       at Microsoft.VisualStudio.TestTools.Agent.AgentObject.<>c__DisplayClass14.<OnSendTestMessage>b__12()
       at Microsoft.VisualStudio.TestTools.Execution.ExecutionUtilities.InvokeController(Action invokeController, String caller, Boolean& connectionLost)
    E, 13772, 17, 2011/08/24, 16:44:38.798, MYHOSTNAME\QTAgent32.exe, AgentObject.OnBackgroundSendTestMessage: Connection to controller was lost. System.Runtime.Remoting.RemotingException: Failed to write to an IPC Port: The pipe is being closed.


    Server stack trace:
       at System.Runtime.Remoting.Channels.Ipc.IpcPort.Write(Byte[] data, Int32 offset, Int32 size)
       at System.Runtime.Remoting.Channels.Ipc.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count)
       at System.Runtime.Remoting.Channels.ChunkedMemoryStream.WriteTo(Stream stream)
       at System.Runtime.Remoting.Channels.Ipc.IpcClientHandler.SendRequest(IMessage msg, ITransportHeaders headers, Stream contentStream)
       at System.Runtime.Remoting.Channels.Ipc.IpcClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
       at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.VisualStudio.TestTools.Controller.IControllerCallback.AgentEvent(String agentName, TestMessage message)
       at Microsoft.VisualStudio.TestTools.Agent.AgentObject.<>c__DisplayClass14.<OnSendTestMessage>b__12()
       at Microsoft.VisualStudio.TestTools.Execution.ExecutionUtilities.InvokeController(Action invokeController, String caller, Boolean& connectionLost)
    The thread 'Agent: heartbeat thread' (0x38f0) has exited with code 0 (0x0).
    The thread '<No Name>' (0xe4) has exited with code 0 (0x0).
    The thread '<No Name>' (0x1e60) has exited with code 0 (0x0).
    The thread '<No Name>' (0x3838) has exited with code 0 (0x0).
    The thread '<No Name>' (0x2f88) has exited with code 0 (0x0).
    The thread '<No Name>' (0x2ef8) has exited with code 0 (0x0).

    In this case, I believe there were a lot of text written to stdout.

    Wednesday, August 24, 2011 11:46 PM