Monday, January 19, 2009

LoadTest Controller

I was in the process of exploring Controller and Agent for Load testing using VSTS 2008. I am facing an issue in the same

"Failed to connect to remote Controller on machine 'tfs_Server', port '6901': No connection could be made because the target machine actively refused it ."

In the process of troubleshooting the problem, I read in one of theblogs is to install Visual Studio 2008 SPI in all the machines involved. i.e Controller, Agent and Client

In my scenario my Controller and TFS Server was the same machine.
I installed it on all machine but after I installed it on my controller machine, I was then not able to connect to my TFS Server from any of my clients.
I got the error below on all my client machines

"TF31001: Team Foundation cannot retrieve the list of team projects from Team Foundation Server tfserver. The Team Foundation Server returned the following error: Team Foundation services are not available from the server.
Technical information (for administrator):
TF30059: Fatal error while initializing web service.

Then I unstalled the SPI from the machine and then was able to successfully connect to the TFS Server

One more problem I faced then was I was getting error as below when I run my Load test.

"No connection could be made because the target machine actively refused it "
On going to the Controller machine and checking the services, the service for the controller was stopped. I tried to start the service manually but then the service stopped by itself giving me a message.

"The Visual Studio Team Test Controller Service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service. "

Then I realised that the whole problem was caused because my controller was a 90 Day or 25 Test Run trial.

Tuesday, January 13, 2009

Reset Database after Unit Tests are run

I was doing RnD using VSTS 2008 for Unit tests. One of the issue I faced was the data used to get changed after my tests were passed. This scenario created one more need for me to find a method to rollback what ever changes my Unit tests used to make to my database.

I tried out MdbUnit, NUnit but I was still searching for something which is provided by Microsoft itself. Reading to few blogs I successfully made it work.

public void Initialize()
ServiceConfig config = new ServiceConfig();
config.Transaction = TransactionOption.RequiresNew;

public void Cleanup()
if (ContextUtil.IsInTransaction)

After I wrote this in my Test.cs file I faced another error
system.Data.Entity Exception: The underlying provider failed on Open. ---> System.Transactions.TransactionManagerCommunicationException: Network access for Distributed Transaction Manager (MSDTC) has been disabled.

The following link helped me

Wallah my Unit test problem is solved!

Wednesday, January 7, 2009

.Net 2.0 Runtime error on Recording Webtest using VS 2008

I faced a issued as follows:

When I start recording a webtest using VS 2008, IE7 or IE6 (Itried both) and Win XP on my machine, IE used to crash. On investigating in the Event viewer it had the following log

".Net 2.0 Runtime error" for iexplore.exe

I tried many settings but it was in vain. I then disabled my McAfee 8.0i on access scan and it worked.