When a sampler has a name which corresponds to the name of a header declared in a HTTP Header Manager component its name is well reported in listeners the first time it is processed but it is replaced by the name of the first variable component (maybe other kind of components are eligible for giving the replacement name) next times the sampler is processed. For instance, consider the following Test Plan : Test Plan |----- Thread Group (looping infinitely) |----- Interleave Controller |----- HTTP Sampler (named "Test 01") |----- HTTP Sampler (named "Test 02") |----- HTTP Sampler (named "Test 03") |----- Results Table |----- Java Sampler (sleep request - optional) |----- HTTP Header Manager (with a header called "Test 02") |----- User Defined Variables (named "My Var") By launching it the Results table listener should display something like this : - Test 01 - Test 02 <==== first time it'OK - Test 03 - Test 01 - My Var <==== next times name is KO - Test 03 - Test 01 - My Var - Test 03 ... Remark : The bug is not linked to the Interleave controller. With a Random controller the same behaviour is observed (the first time test #2 is processed "Test 02" is displayed, next times the name is replaced by "My Var").
Bug is also not dependent on any controllers - all it needs is a Header Manager and sampler with the same name as a header. I've fixed the code in CVS Head - I hope.
The fix seems to work, but changes the name of one of the entries in test plans, so is not backward compatible - i.e. existing plans don't work... This obviously needs to be backed-out or further fixed. By the way, a header manager should normally be added as a child of the target http sampler. In your example the Header Manager is in scope for all the samplers...
Using a same HTTP Header Manager with several samplers is another subject, isn't it ? Moreover I have not found such a restriction in User's manual. I only saw that point : "If there is more than one Header Manager in the scope of a Sampler, there is currently no way to specify which one is to be used." (which is not the same thing) In any cases if the HTTP Header Manager is in the scope of all the samplers in my example this is because, in my personal case, same headers have to be used for all the samplers (duplicating the HTTP Header Manager would not be very user-friendly and especially not easy to maintain).
Yes, you can share the HeaderManager between samplers. In your case you could add it to the InterLeave Controller, so that it only applied to the HTTP samplers. == I've updated CVS again - this time existing test plans should still work.
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1561