If you are getting following error while running load test and wondering why this happens. Here in this blog entry I highlight ways to fix it.
The performance counter category ‘Memory’ cannot be accessed on computer ‘COMPUTER01’ (Timed out trying to read performance counter category ‘Memory’ on computer ‘COMPUTER01’); check that the category and computer names are correct.
Performance Monitor Tool (perfmon)
This is a well known Windows in-build tool for fetching performance data. First try to fetch the required performance counter from specific machine through this tool. You may notice two things here if your machine is a remote machine. If it takes more time (more than 1/2 minutes) to get the performance counters, that will indicate that you need to change timout values for load test configuration. OR if it does not access the counter then there are permissions issue.
Performance Monitor User Permissions
If you are not able to access performance data from perfmon, then you have to correct that first. As same permission level applies to visual studio load test when it tries to fetch performance data. User who is trying to access performance data (locally/remotely) should be part of ”Performance Monitor Users” and “Performance Log Users”. If there are not much security concerns make the user part of Local “Administrators” group which will ensure full access on the machine.
Sometimes still there may be some issues. In that case just remove the User or the Group of which the User is part of, from “Users” Group of target machine. Which will provide you fully un-restricted access to machine.
Rarely you may have to do it. Either turn off the local firewall or enable the rules for Performance Logs and Alerts in the Windows Firewall with Advanced Security snap-in.
Load test timeout settings
If permission levels are all fine. But still you are still running into the same issue. That means you have to set load test’s performance counter initialization time out settings. But where to do that? as there is no provision to do it though VS IDE. For that you have to do some manual configurations in load test’s hosting process’s configuration file. Now this configuration file is different for VS 2008 and VS 2010. Following are the details on that.
For Visual Studio 2008, open the file VSTestHost.exe.config in the folder C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
For Visual Studio 2010, open the file Devenv.exe.config in the folder C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
AND then add following entries to it. That will solve the timout issue.
<add key=”LoadTestCounterCategoryReadTimeout” value=”60000″/>
<add key=”LoadTestCounterCategoryExistsTimeout” value=”60000″/>
This weekend I came across a new development in VS Coded UI Testing. Called CUITe (Coded UI Test Enhanced). This is a codeplex project. It is a wrapper over visual studio’s coded UI test framework. Following are some very interesting features worth trying. I am sure whole automated functional testing community has faced lot of issues with Coded UI test. Specially with code maintainability and readability. This wrapper has tried to answer these two. So, here are some interesting things about CUITe.
- Simple to setup and use. Just install and refer to one dll “CUITe.dll” in your automation project.
- It keeps UI Object definitions separate from automation code. BIG Relief.
- Web Automation: Treat table as Table.
- Support for Custom UI objects.
- Supports SilverLight and whatever Coded UI Test supports underneath.
- No more misnomer UI object type names.
- Common behavior has been moved to base classes.
- Automation code becomes more readable and maintainable.
Interesting feature. Which can be used to handle some tricky situations. For example invoking context menus on web pages which sometimes can not be invoked by mouse click API.
Visual Studio 11 Dev Preview
The next version of Visual Studio and .NET framework contains many new features and enhancements, making job of .NET developer easy. So why to wait. Just get started.
Following are the steps :
- Delete all bin and obj files
- Copy paste any snk file where it is required
- Set appropriate debug type you want for the project
- Right click on addins project , set “addin project” as startup project
- Right click on “addins project”, select properties and set as shown in the screen shot below
- Set Start external program C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
- Set Command line arguments /resetaddin <addin lib name without extention>
- Set working directory C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
- Create folder addins in C:\Users\<user>\Documents\Visual Studio 20101\Addins
- Copy paste the addin definition file and set the parameter <Assembly> as <Assembly>Path to AddIn.dll</Assembly>
- Make sure that in addin definition file value of <FriendlyName> node should be exactly same as that of addin definition file name.
- Run the project in debug mode.
Following are the issues we face due to limitations in default build template. Which require some customization to meet our requirements. The following are the limitations found:
- The workflow treats a solution as single project
- The output of building projects in a solution doesn’t follow the same output directory structure when building in visual studio. For instances, web applications output binaries in the Bin folder while ClassLibrary and Windows applications projects output binaries into the Bin\(configuration) folder.
- In visual studio, binaries are copied to a bin/(configuration) folder where “configuration” is the configuration of the build (e.g. debug, release..etc) whereas the team build outputs all binaries into one folder called Binaries and that folder doesn’t contain sub folders per project
MSDN has many videos that show how you can use Visual Studio ALM tools and Team Foundation Server to help your team develop software more successfully. Here is the list of most important ones
New to TFS 2010? Where to Begin?
Here is the answer to these questions. Here is a Training Kit, which is designed to help you understand what TFS 2010 can do for your organization and software process. It applies to all members of the team – developers, testers, business people and of course, managers.
This training kit will give a glimpse of what TFS 2010 is all about. Download your kit here.
I configured three build agents on the same machine with same configuration (lets say A1, A2, and A3). I reserved A1 and A2 for some builds say B1 and B2 using build definition process configuration. Everything worked fine till I deleted those builds (B1, B2) as I was experimenting with them. Now once I deleted them, reserved build agents A1, A2 were there but were not doing any thing. For example if I queued 3 builds at a time they were being processed by only A3. So I thought of deleting these build agents. Adding salt to wound I was not able to delete that, showing a dialog with message
--------------------------- Team Foundation Build Configuration --------------------------- Cannot delete agent 'A3': The build agent A3 cannot be removed from build controller C1 because it is currently reserved for a build. --------------------------- OK ---------------------------
On my pursuit to solve this issue, I ended up exploring TFS 2010 db for my project collection and here is what I found.
“tbl_BuildAgentReservation” is the table which retails the reservation details.
“tbl_BuildAgent” the refers to PK of tbl_BuildAgentReservation for reservation ids against build agent entries.
So, these two tables maintains that blocking link. Once you break it, issue is resolved. And I did the same. Following are the queries you can run to break this reservation.
SELECT * FROM tbl_BuildAgent Locate the build agent in question then note the value of ReservationId and AgentId and Execute the following SQL statements: DELETE FROM tbl_BuildAgentReservation WHERE ReservationId = [ReservationId] UPDATE tbl_BuildAgent SET ReservationId = NULL WHERE AgentId = [AgentId].