다음을 통해 공유


Bug in VSTS 2008 SP1 causes think time for redirected requests to be ignored in a load test

Unfortunately, late last week we discovered a nasty bug with load testing in VSTS 2008 SP1 that is a regression from the original RTM version of VSTS 2008: for Web test requests that result in redirects, any think time that is specifed on the request is ignored when the Web test is run in a load test.   Even more unfortunately, VSTS 2008 SP1 has been locked down for changes, so the fix for this problem will not make it in.  We will need to create a QFE to be applied to SP1 to fix the problem.  It takes some time to get through the QFE process.    In the meantime, it is possible to workaround this bug by adding a Web test plugin to each Web test used in a load test that uses redirects and think times (probably most Web tests).  The work around is to add the following WebTestPlugin to your test solution, and then add the Web test plug-in to each Web test (fortunately a Web test can have any number of plug-ins):

using Microsoft.VisualStudio.TestTools.WebTesting;

namespace TestProject1    // Change the name space as appropriate
{
    public class WebTestPlugin_FixThinkTime : WebTestPlugin
    {
        private WebTestRequest m_currentPageOriginalRequest;

        public override void PostRequest(object sender, PostRequestEventArgs e)
        {
            base.PostRequest(sender, e);

            if (!e.Request.IsRedirectFollow)
            {
                m_currentPageOriginalRequest = e.Request;
            }
            else
            {
                if (m_currentPageOriginalRequest.ThinkTime == 0 && e.Request.ThinkTime != 0)
                {
                    m_currentPageOriginalRequest.ThinkTime = e.Request.ThinkTime;
                }
            }
        }
    }
}

If you are already using VSTS 2008 SP1 Beta1, can you add this plug-in now to fix the existing bug, and the plug-in will still work when the final version of SP1 ships, and will not cause any harm once the QFE that fixes the bug is available (though it could be removed at that point).

Comments

  • Anonymous
    August 04, 2008
    PingBack from http://wordnew.acne-reveiw.info/?p=15895
  • Anonymous
    August 11, 2008
    SP1 has shipped. As I blogged about before here and here , there is a lot of good stuff in SP1 for TeamTest.
  • Anonymous
    August 12, 2008
    You've been kicked (a good thing) - Trackback from DotNetKicks.com
  • Anonymous
    August 19, 2008
    Check out James's recent post with the eye-catching title “if Microsoft is so good at testing, why does
  • Anonymous
    September 10, 2008
    The comment has been removed
  • Anonymous
    December 10, 2008
    the link seems to be broken. Thanks
  • Anonymous
    February 16, 2009
    The above think time hotfix seems to be for X86 machines. does this work for x64 machines also? if not let me know the location from where i can download the same for x64 machines