Friday, August 17, 2012

VS 2010 Load Test - Save and View Test Logs

In VS 2010 Load Tests, the failed test logs are saved by default.
This is because the setting Save Log on Test Failure is set to True

However, if you want to save the logs even for the passed tests, you can do that by changing the setting Save Log Frequency for Completed Tests

Note that the maximum number of test logs saved in both cases is controlled by the setting Maximum Test Logs

You wont be able to see these logs while the load test is running. However, once the load test is complete, you can see these logs by going to Tables->Test Details

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.

TFS 2012 RC - There is no agent with the name 'XXX' registered on the controller

If you see this error in the event log on the test agent:
Unable to connect to the controller on 'yyy:6901'. There is no agent with the name 'XXX' registered on the controller.

You will also be able to see the detailed error if you click on View Log while configuring the Test Agent:
V, 2012/08/08, 18:55:31.882, Observed that agent XXX does not exist. Microsoft.VisualStudio.TestTools.Exceptions.EqtException: There is no agent with
the name 'XXX' registered on the controller.
Server stack trace:
   at Microsoft.VisualStudio.TestTools.Controller.AgentManager.GetAgentMachine(String agentName)
   at Microsoft.VisualStudio.TestTools.Controller.AgentManager.GetAgentProperties(String agentName)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.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.IControllerCommands.GetAgentProperties(String agentName)
   at Microsoft.VisualStudio.TestTools.ConfigCore.TestControllerHelper.AgentExists(String agentName, IControllerCommands controllerCmds)


The fix is to make sure that while configuring the test agent, you type the test controller name in the same case as the computer name of the test controller. So if the computer name of the test controller is YYY, make sure that you type YYY and not yyy

Thursday, July 26, 2012

Windows Azure Tools 1.6 - Fatal Error 0x80070643

I was trying to install Windows Azure Tools 1.6 on one of my build agents but was getting a Fatal Error during installation

I tried various uninstallations and installations but nothing seemed to work.
The log file didn't point to anything specifc but then I found this in the log file:
[0F28:0D3C][2012-07-26T19:24:54]: Setting string variable 'WixBundleLog_CctSetup.Shared' to value 'C:\Users\xxx\AppData\Local\Temp\2\Windows Azure Tools for Microsoft Visual Studio 2010_-_November 2011_20120726192451_0_CctSetup.Shared.log'

I opened CctSetup.Shared.log file and found:
MSI (s) (54:10) [19:24:54:839]: Product: Windows Azure Tools for Microsoft Visual Studio 2010 Core -- Windows Azure Tools for Microsoft Visual Studio 2010 Core requires the Windows Azure Emulator.  Please install the Windows Azure Emulator and try again.
Action ended 19:24:54: LaunchConditions. Return value 3.
Action ended 19:24:54: INSTALL. Return value 3.
MSI (s) (54:10) [19:24:54:839]: Note: 1: 1708
MSI (s) (54:10) [19:24:54:839]: Product: Windows Azure Tools for Microsoft Visual Studio 2010 Core -- Installation failed.


This reminded me that I had installed the Windows Azure SDK but not Windows Azure Emulator.
I installed Windows Azure Emulator and then the installation of Windows Azure Tools 1.6 was successful.

VS 2010 Load Test - Percentile values for Transaction Response Time

In VS 2010, when the load test run is complete, you can view the percentile values for transactions. Remember that these are percentile values and not percentage values.

Consider there are 10 requests where request1 to request9 took 1sec and request10 took 5 sec.
So the percentage of requests which took less than or equal to 1 sec is  9*100/10 = 90 percent

However, to calculate the percentile, we have to arrange the values in a sorted manner i.e.
1,1,1,1,1,1,1,1,1,5

Now, to calclulate the percentile, we calculate the rank by using the formula:
n = (P*N)/100 + 1/2 where P is the percentile and N is the number of items.

So the rank for 90th percentile will be:
n = (90*10)/100 + 1/2 = 9.5
We round off the rank and pickup the the nth element i.e. the 10th element i.e. 5

Thus the 90th percentile value is 5 sec but 90 percentage of transactions took 1 sec.

You can view Percentile values of 90%, 95% and 99% for each transaction in Tables->Transactions


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.

Sunday, July 1, 2012

Congratulations 2012 Microsoft MVP!

I am so excited to receive the MVP award again. I received an email from Microsoft  today which states:

Dear Anuj Chaudhary,

Congratulations! We are pleased to present you with the 2012 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Visual Studio ALM technical communities during the past year.


Here is the link to my profile https://mvp.support.microsoft.com/profile/Anuj