none
Setup Script timeout on test agent RRS feed

  • Question

  • I have a setup script to run from test agent machine before running the actual automation. This script (not a powershell script )takes more than 15 mins to complete.

    Once I kick off test automation from test manager execution starts with running this setup script (as in test setting defined for execution) but after 5 mins test manager shows error -"06/24/2011 11:38:55" "Timestamp '6/24/2011 6:38:48 PM'; TestOutcome 'Error'; Message 'The setup batch file on agent machine 'VM-test' exceeded the execution timeout period.'."  

    I have tried configuring values in different config file on test agent and controller ( put larger value for AgentSyncTimeoutInSeconds, StopTestRunCallTimeoutInSeconds etc as in this link http://msdn.microsoft.com/en-us/library/ff934570.aspx )but no result.

    Any resolution to this problem ?

    Thanks

     

    Wednesday, June 29, 2011 10:33 PM

Answers

  • Hi,

    Ideally, you should have been able to change the script timeout using tfs api's. An sample tool for changing the deployment timeout is present at http://blogs.msdn.com/b/aseemb/archive/2010/08/06/update-testsettings-utility.aspx

    However, Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration does not contain a public ScriptTimeout property unlike the DeploymentTimeout property. You might have to override it using refection which might be some pain.

    Hence, instead of using a setup script, you can do the following:

    If you are doing a build-deploy-test workflow using LabDefaultTemplate.xaml, you can specify the setup script in the deployment section so it will run before the tests execute.

    If you are just running tests through MTM, you can run the setup script manually before running the tests.

    Thanks,

    Anuj


    http://www.anujchaudhary.com/
    Friday, July 15, 2011 12:43 AM
  • Hello,

     

    Thanks a lot, it worked!

    For future reference, I've used the sample tool you've suggested, with a minor adaptation to get and set the property ScriptTimeout using reflection:

          PropertyInfo pInfo = testRunConfiguration.GetType().GetProperty("ScriptTimeout", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance);
    
          int scriptTimeout = 600000;
          pInfo.SetValue(testRunConfiguration, scriptTimeout, null);
    
          UpdateTestSettings(testSetting, testRunConfiguration, commandParameters);
    

    I've already tested and it seems that it worked.

     

    Thanks Again,

    Telmo

     

    Friday, July 15, 2011 11:10 AM

All replies

  • Hi there,

    I belive we share a similar configuration (setup script without powershell ), and our tests usually take something like 7m to perform the setup, so most of the times they fail with the exact same error (TestOutcome 'Error'; Message 'The setup batch file on agent machine 'XXX' exceeded the execution timeout period.'.")  . Have you already found a solution for this?  Or does anyone else knows which is the timeout we have to change, and where?

     

    Thanks

    Monday, July 11, 2011 6:18 PM
  • Hi,

    Ideally, you should have been able to change the script timeout using tfs api's. An sample tool for changing the deployment timeout is present at http://blogs.msdn.com/b/aseemb/archive/2010/08/06/update-testsettings-utility.aspx

    However, Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration does not contain a public ScriptTimeout property unlike the DeploymentTimeout property. You might have to override it using refection which might be some pain.

    Hence, instead of using a setup script, you can do the following:

    If you are doing a build-deploy-test workflow using LabDefaultTemplate.xaml, you can specify the setup script in the deployment section so it will run before the tests execute.

    If you are just running tests through MTM, you can run the setup script manually before running the tests.

    Thanks,

    Anuj


    http://www.anujchaudhary.com/
    Friday, July 15, 2011 12:43 AM
  • Hello,

     

    Thanks a lot, it worked!

    For future reference, I've used the sample tool you've suggested, with a minor adaptation to get and set the property ScriptTimeout using reflection:

          PropertyInfo pInfo = testRunConfiguration.GetType().GetProperty("ScriptTimeout", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance);
    
          int scriptTimeout = 600000;
          pInfo.SetValue(testRunConfiguration, scriptTimeout, null);
    
          UpdateTestSettings(testSetting, testRunConfiguration, commandParameters);
    

    I've already tested and it seems that it worked.

     

    Thanks Again,

    Telmo

     

    Friday, July 15, 2011 11:10 AM
  • Glad to know that it worked and thanks for posting.

    Thanks,

    Anuj


    http://www.anujchaudhary.com/
    Saturday, July 16, 2011 1:41 AM