This is a migrated thread and some comments may be shown as answers.

Event log error when using Telerik Testing Framework from MsTest

9 Answers 165 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 24 Nov 2011, 06:59 AM
An error appears in the Application event log at the end of any MsTest run that includes a test that uses the Telerik Testing Framework:

(QTAgent32.exe, PID 13180, Thread 8) ResolutionAppDomainHelper.Unload: An error occurred while attempting to unload the tests AppDomain.  The AppDomain may still have foreground threads executing.

My test is simple, just launch a browser:

        [TestMethod]
        public void EventLogError_Test()
        {
            Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
        }

        [TestCleanup()]
        public void MyTestCleanup()
        {
            // Shuts down WebAii manager and closes all browsers currently running
            this.CleanUp();
        }

Please find attached this simple test project, after the test run completes, check your Windows event log (Application) for the error.  I'm not sure what the side effects of this error are, it doesn't seem to affect the test result. 

9 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 29 Nov 2011, 02:16 PM
Hi Peter,

I'm sorry you are running into this problem.

This error is not from Test Studio, and maybe it is somehow machine specific, I was not able to reproduce it locally as you can see from this video:  http://screencast.com/t/rUqBVQXDsY .

A quick Google search shows that the same error is already reported to Microsoft. Here's a link:
http://connect.microsoft.com/VisualStudio/feedback/details/610988/qtagent32-crashes-on-running-unit-tests

Please try to reproduce this issue on a different machine and let us know of the result!

All the best,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Peter
Top achievements
Rank 1
answered on 01 Dec 2011, 11:46 AM
We have reproduced this error on 4 machines: 

Windows XP
Windows 7 x64
Windows 7 x64 SP1
Windows Server 2008 R2

But since there's no obvious side-effect to us, this is pretty low priority if you guys can't reproduce it.  
0
Plamen
Telerik team
answered on 01 Dec 2011, 12:33 PM
Hello Peter,

Thank you for your understanding and for the additional information! We will continue looking into this and I can assure you that if we find a way to reproduce it and the problem is somehow connected to our Testing Framework, we'll do our best to fix it ASAP.

All the best,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Claus
Top achievements
Rank 1
answered on 02 Jan 2012, 07:45 PM
We see this problem all the time -- QTAgent crashing / keeping locks on the test dlls. When the tests are run from inside VS2010, the side-effect is very annoying: It's impossible to compile again until either the QTAgent process is killed manually or by restarting VS2010.

It seems to happen only when testing with FF and IE, not Chrome. Also it seems to happen more if the browser is closed before the test is completely done in VS2010.

I agree it's a known MS bug, but it appears 100 times more frequently with Telerik Testing Framework than with any of our other unit test projects (including a lot of Selenium tests).

Kind regards
Saxo Bank A/S

Claus Topholt
0
Plamen
Telerik team
answered on 04 Jan 2012, 02:09 PM
Hello Claus,

I'm sorry to hear you are still experiencing this problem. You state that the problem occurs more often if the browser is closed before the test is completely done. Could you elaborate more on what are you doing differently that causes the browser to crash? Any further details you can provide are welcome.

Also, please try to upgrade to our latest internal build (2011.2.1303), not a great chance to fix it, but there is a chance. The build contains many bug fixes and improvements versus our 2011.2.1108 that you are currently using(according the info in your account). You can download it from here: Public URL

If you still have this problem after the upgrade, please provide a video demonstrating the issue. Jing is a free and decent screen recorder. In this way, maybe we will be able to see some indication of why the problem occurs on your machine.

Kind regards,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Claus
Top achievements
Rank 1
answered on 04 Jan 2012, 09:02 PM
It occurs when in debug mode, and when hitting breakpoints. Sometimes we close down the browser before the test is completed after sitting on a breakpoint for some time, and then manually stop the test (shift-F5 or whatever). That seems to cause the problem more than anything else.

Interestingly, since we moved the Telerik project into another Solution with 10 other projects (ASP.NET, class libs, unit tests, etc) -- all in TFS -- the problem seems to be gone. Also we've upgraded to 2011.2.1303, perhaps that did something as well.

Kind regards
Saxo Bank A/S

Claus Topholt
0
Plamen
Telerik team
answered on 05 Jan 2012, 11:40 AM
Hello Claus,

I'm glad to hear that the QTAgent crashing problem is resolved. I've tried your approach to manually stop the test after sitting on a breakpoint, but I was not able to reproduce the issue. 

If the issue appear again with our latest release, please reply back and let us know, so we can continue troubleshooting. 

All the best,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Peter
Top achievements
Rank 1
answered on 16 Jan 2012, 02:54 AM
I just re-ran the test application I uploaded using the latest build (2011.2.1305.0) and the error in the event log no longer occurs.  However, the issue with not being able to compile after a test-run is still present.  Using the test project attached to this bug, after you run the test, you cannot build the solution due to:

Error    2    Unable to copy file "obj\Debug\TestProject1.dll" to "bin\Debug\TestProject1.dll". The process cannot access the file 'bin\Debug\TestProject1.dll' because it is being used by another process.    TestProject1
Warning    1    Unable to delete file "D:\Downloads\316585_EventLogError-TestProject1\EventLogError.TestProject1\TestProject1\bin\Debug\TestProject1.dll". Access to the path 'D:\Downloads\316585_EventLogError-TestProject1\EventLogError.TestProject1\TestProject1\bin\Debug\TestProject1.dll' is denied.    TestProject1

Using Process Explorer, you can see that QTAgent32.exe is holding a handle to TestProject1.dll.  The only work-around is to kill QTAgent32.exe after every test run, which is pretty inconvenient.  Hopefully you guys can reproduce this issue.

Thanks.
0
Plamen
Telerik team
answered on 17 Jan 2012, 01:42 PM
Hi Peter,

I'm not sure if this will make any difference, but try including the tear down code (and don't use ActiveBrowser.Close(); since our tear down code does this for you). Our standard tear down code looks like this:
// Use TestCleanup to run code after each test has run
[TestCleanup()]
public void MyTestCleanup()
{
   
    //
    // Place any additional cleanup here
    //
   
    #region WebAii CleanUp
   
    // Shuts down WebAii manager and closes all browsers currently running
    // after each test. This call is ignored if recycleBrowser is set
    this.CleanUp();
   
    #endregion
}
   
//Use ClassCleanup to run code after all tests in a class have run
[ClassCleanup()]
public static void MyClassCleanup()
{
    // This will shut down all browsers if
    // recycleBrowser is turned on. Else
    // will do nothing.
    ShutDown();
}

Let me know if it works!

Regards,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Peter
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Peter
Top achievements
Rank 1
Claus
Top achievements
Rank 1
Share this question
or