MSTest with noisolation not working

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
idris
Posts: 2
Joined: Tue Jul 26, 2011 6:16 am

MSTest with noisolation not working

Post by idris » Tue Jul 26, 2011 8:20 am

Hi,

In our organisation we have used .Net Memory Profiler and found it worked excellent and very helpful. Now we are planning to use it for Unit Test Automation process to check for memory leaks.We are suing VS 2008 and MS Unit test for this.

I started with the sample unit test application and found that "MemProfiler.IsProfiling" is returning false. I tried with the VS 2008 command prompt and "noisloation" arguement but still the result is the same (MemProfiler.IsProfiling is false) - D:\>mstest /noisolation /testcontainer:D:\Work\LeakTest\TestProject1\bin\Debug\TestProject1.dll - Is this right way to do?
I have also attached my source files. I have added the referece of "C:\Program Files\SciTech\NetMemProfiler3\Redist\MemProfiler2.dll"

Reading at some of your posts at this forum i am bit puzzled whether we can go with VS2008 and MSTest for Automation Process. Could you please let us know we can achive automation process with these?

Thanks,
Idris
Attachments
TestProject1.zip
My test project.
(7.09 KiB) Downloaded 324 times

Andreas Suurkuusk
Posts: 1028
Joined: Wed Mar 02, 2005 7:53 pm

Re: MSTest with noisolation not working

Post by Andreas Suurkuusk » Tue Jul 26, 2011 10:03 pm

How do you start the MSTest process? From your example, it seems like you start it directly from the command line. In order for the profiling assertions to work, MSTest must be started by the profiler. Use the Profile application command and enter the path of MSTest, your command line arguments, and a suitable working directory (see screenshot below).
LeakTest.png
Start MSTest profiling
LeakTest.png (49.84 KiB) Viewed 7133 times
In order to avoid that the MSTest application exits before the profiler has been able to collect any assertion failure data, you need to enable the "Suspend thread until memory leak is handled" option (under the Memory leak settings page).
LeakTest2.png
Suspend thread
LeakTest2.png (57.25 KiB) Viewed 7133 times
For automated testing, I recommend that you create a project with the above settings. Then you can use that project and start profiling from the command prompt. For example by using the following command line:

"c:\Program files\SciTech\NetMemProfiler3\NetMemProfilerConsole.exe" /prj d:\work\LeakTest\LeakTest.prj
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 24 guests