Showing posts with label mtm. Show all posts
Showing posts with label mtm. Show all posts

Wednesday, August 8, 2012

TFS 2012 RC - Test Controller is shown as offline

If you go to Microsoft Test Manager->Lab Center->Controllers and see the Test Controller as offline, check the event logs on the same machine.
If you see the below error:
The description for Event ID 0 from source VSTTExecution cannot be found. Either the component that raises this event is not installed on your local computer
or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
(mtm.exe, PID 2968, Thread 13) ControllerConnectionManager : InternalConnect : System.Net.Sockets.SocketException (0x80004005): The requested name is valid,
but no data of the requested type was found
Server stack trace:
   at System.Net.Dns.GetAddrInfo(String name)
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
   at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
   at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()
   at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
   at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.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.Execution.IControllerAccessManager.get_ControllerVersion()
   at Microsoft.VisualStudio.TestTools.Execution.ExecutionUtilities.GetControllerVersion(IControllerAccessManager accessManager, Boolean

tolerateOldControllers)
   at Microsoft.VisualStudio.TestTools.Controller.ControllerConnectionManager.InternalConnect(ControllerConnectionInfo controllerConnectionInfo)

the message resource is present but the message is not found in the string/message table

Find out the exact machine name for the test controller by running the following query:
USE [Tfs_DefaultCollection]
GO

SELECT [PartitionId]
      ,[InternalId]
      ,[Name]
      ,[Description]
      ,[GroupId]
      ,[LastHeartbeat]
  FROM [dbo].[tbl_TestController]
GO


Then make sure that you are able to ping the full computer name which is present in the [Name] column (exclude the port number) .
The issue I was facing was that I was able to ping the computer name but not the full computer name. Once you are able to ping the full computer name, reconfiguring the test controller should fix the issue.

Thursday, July 19, 2012

TFS 2010 - How to fix the issue with automated tests getting aborted in Test Manager

I had been running all my tests for a long time using Build-Deploy-Test workflow (http://social.technet.microsoft.com/wiki/contents/articles/tfs-2010-build-deploy-test.aspx)

Suddenly one day, the test runs started getting aborted and there was no specific log which pointed to the root cause.

To find the root cause, I ran all the tests locally from Visual Studio and tried to publish the results against a build from the Test Results window.

The publish failed with the error:
Failed Invalid character in Assert.AreEqual failed. Expected:xxx Actual:yyy

The problem was that xxx and yyy had some invalid characters which was causing the publish to fail. I fixed the test by comparing expected and actual and doing Assert.Fail() if they didn't match. Thus, the invalid characters were not logged to console and the publish started to succeed.

Problem solved and the test runs started getting completed.

Friday, July 15, 2011

Microsoft Test Manager - Update Test Settings

Here is a great source for updating the test settings in MTM http://blogs.msdn.com/b/aseemb/archive/2010/08/06/update-testsettings-utility.aspx

You can override public properties like Deployment Timeout using this.

You can also override the private properties like Script Timeout using Reflection. Please refer this thread for more info http://social.msdn.microsoft.com/Forums/en-US/vsmantest/thread/5a6f3af4-9e28-42d9-8830-f800969d8b28/