none
MTM is running QTAgent32_40.exe instead of QTAgent32.exe RRS feed

  • Question

  • Hello guys. This has been bugging me for couple days now.

    I have a test dll that is built with 'AnyCPU' and targeted at .Net framework 4.5

    When i run MSTest.exe, i can see that it starts QTAgent32.exe process and the test gets run successfully. By the way, part of the test is connecting to a sql database server. I can see i can connect to it and run the queries

    To be exact that it actually starts QTAgent.exe, i printed a couple of lines like this

    Console.WriteLine(@"The current executing assembly that contains the code that is executing: {0}",System.Reflection.Assembly.GetExecutingAssembly()); Console.WriteLine(@"Current active Process Name: {0}", System.Diagnostics.Process.GetCurrentProcess().ProcessName);

    Console.WriteLine(@"Current active Process Name: {0}", System.Diagnostics.Process.GetCurrentProcess().Id);

    Now, When i run the test from MTM, i the same Console.WriteLine is printing that my current process is QTAgent32_40.exe. I don't know, but in this case i get an error saying login failed for <user> while the test connects to sql server.

    How can i make MTM run QTAgent32 instead of QTAgent32_40

    I do not have .net 4.0 on the machine. I only have .Net framework 4.5. My visual studio is ultimate 2012. My TFS is 2012

    Friday, April 19, 2013 11:13 PM

All replies

  • Hi,

    Thank you for your post.

    Under C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE, I find different version of QTAgent.exe. It seems test agent determine which one to run. Would you please let us know why you want run QTAgent32.exe instead of QTAgent32_40.exe? Is there any issue occur relate this?

    Regards,


    Lily Wu
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 22, 2013 8:39 AM
    Moderator
  • Is it the test agent that determines which version of qtagent.exe to run or the test controller that does this?

    As i said in my previous post, when i run with mstest, it picks up QTAgent32.exe, but when i run my test case from MTM, it picks the QTAgent32_40.exe in which case there is a failure in my test cases saying that "The underlying provider failed on Open, Login failed for User" (sql login).

    I use the sqclent.dll provider for connecting to the database.

    So, what i am asking is why would a test agent pick QTAgent32_40.exe when there is QTAgent32.exe on a Windows server 2012, TFS 2012, Visual Studio 2012. Do you know what i should do so that it picks QTAgent32.exe

    thanks

    Monday, April 22, 2013 6:00 PM
  • Hi,

    Thank you for your post.

    I am trying to involve someone to further look at this issue. There might be some time delay. Appreciate your patience.

    Thank you for your understanding and support.

    Regards,


    Lily Wu
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, April 23, 2013 5:33 AM
    Moderator
  • There're three variants of QTAgent.exe, regardless the x86/x64:

    1. QTAgent32.exe: gets called if test assembly targeting .NET 4.5
    2. QTAgent32_35.exe: gets called if test assembly targeting .NET 3.5
    3. QTAgent32_40.exe: gets called if test assembly targeting .NET 4.0

    If the test assemblies targeting multiple versions of .NET, higher version gets called. Which one does your test assembly targeting?


    Forrest Guo | MSDN Community Support | Feedback to manager

    Tuesday, April 23, 2013 1:10 PM
    Moderator
  • The test assembly is targeting .Net 4.5 and all the assemblies it references are also targeting .Net framework 4.5

    When i run the test using Mstest.exe (i.e Open developer command prompt and run mstest.exe /testcontainer:<testdll filepath> /test:testname, i can see QTAgent32.exe process started.

    When i debug the test (i.e right click inside the test in visual studio or ctrl+r, ctrl+l), i can see QTAgent.exe process started)

    But when i run the test from mtm (by having a test controller on the server and test agent  on the box where i want the test to run), i can see it starting QTAgent32_40.exe

    The test case basically tries to connect to sql server and updates a database. when the test is running through MTM, it says Login failed for user.. Below is the stack trace (only what is needed). Remember i do not get this exception if i run through MSTEST or from Visual Studio

    The underlying provider failed on Open.
       at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
       at System.Data.EntityClient.EntityConnection.Open()
       at System.Data.Objects.ObjectContext.EnsureConnection()
       at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
       at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) <<<<<This is where i run my linq query. as you might already know, ToList will immediately run the query)

    InnerException

    Login failed for user 'xxxxx\username'.
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions userOptions)
       at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
       at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
       at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
       at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
       at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
       at System.Data.SqlClient.SqlConnection.Open()
       at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)

    Tuesday, April 23, 2013 4:34 PM
  • There should be something wrong in process of test assembly deployment, MTM local to Test Agent. Let me ask other people to help, please wait some time.


    Forrest Guo | MSDN Community Support | Feedback to manager

    Wednesday, April 24, 2013 2:50 AM
    Moderator
  • Thanks Forrest. Appreciate your help

    MTM deploys the test assemblies from our official build that is on a share.

    Thursday, April 25, 2013 5:48 PM
  • Hello,

    I don't think the QTAgent32_40.exe is related to the exception.

    From the InnerException, it is a permission issue. Please check if the account displayed in the exception has the proper permission in SQL Server. Is this account that the Build Service is running under?

    Thanks & Regards,

    Jian-Wei Yu [MSFT]

    Microsoft Online Community Support

    --------------------------------------------------------------------------------

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Wednesday, May 1, 2013 7:33 AM

  • I have a problem with a test agent that is always picking QTAgent32_40.exe, and the test execution that works perfect on my DEV machine with QTAgent32.exe, fails to find a Method on the test agent and crashes my CodedUI. Is there any way to modify this behavior? Who is responsible for picking the QTAgent version???
    Monday, July 15, 2013 11:08 PM