Reputation: 819
I created a Web Performance Test for a site which seems to be working fine. It's a simple test for logging in and testing the navigation. Running that test solely works every time. But the problem shows up when I call that test in in a LoadTest. So, I created a load test with only this web performance test in it and it fails all the time right after logging in because of this error:
The server committed a protocol violation. Section=ResponseStatusLine
I've researched this error a lot, and everyone suggests that inserting this statement:
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing=”true”/>
</settings>
</system.net>
in the web.config file solves the issue, but usually QA is separated from DEV and we have no access to their code. I'm just wondering how can the test work when executed individually and not in a load test. I thought the problem might be the number of users or the load pattern, so I set it from my initial Step load pattern
to a Constant load pattern
with only one user. Still, the same error causes the test to fail. Did anyone have a similar issue? If you need any more data, just let me know.
EDIT: When I specified a proxy (localhost:8888 - for fiddler) in the performance test that the load test uses, the issue didn't occur, but the load test was too slow.
Upvotes: 3
Views: 1655
Reputation: 21
I got exactly the same problem. My test environment is using SSL and is load balanced using an F5 load balancer. I was not getting the problem in a non-load balanced configuration.
A webtest when run does not cache dependent requests whereas the loadtest will cache dependent requests, hence the different behavior encountered.
To get around this problem you need to create a plug in to force dependant requests not to be cached in the load test. The following article tells you how to create a plug in.
http://msdn.microsoft.com/en-us/library/ms243191.aspx
Plug in Code Required:
using System;
using Microsoft.VisualStudio.TestTools.WebTesting;
namespace DisableCache
{
public class DisableCache : WebTestPlugin
{
public override void PostRequest(object sender, PostRequestEventArgs e)
{
foreach (WebTestRequest dependentRequest in e.Request.DependentRequests)
{
dependentRequest.Cache = false;
}
}
}
}
Upvotes: 2
Reputation: 24556
In the past, I got this error because of extra \n in the Url.
In my case, this was caused by a dynamic datasource. Parameter in the datasource should be cleaned. Are you using DataSource in your Test ?
Upvotes: -1