You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by "KingRabbid (via GitHub)" <gi...@apache.org> on 2024/01/12 22:20:34 UTC
[I] HeaderManager in a loop is cleared from header definitions if some specific samplers are executed before [jmeter]
KingRabbid opened a new issue, #6224:
URL: https://github.com/apache/jmeter/issues/6224
### Expected behavior
Using HTTP Header Manager elements at various levels in the tree (but a single manager per tree level) should result in the header list merge and the result to be used when HTTP Request is sent.
### Actual behavior
Some Samplers (from the default list I found JUnit Request) seem to impact the content of the merged HTTP Header Manager when everything is wrapped in a loop and as a result the correct list of HTTP headers isn't submitted to target endpoint.
The problem seems to be related to where the Header Manager is defined: one level above the HTTP Request sampler but child of a Loop controller OR on same level with the HTTP Request sampler and child of a Loop controller.
I've tried with other samplers but they don't induce same outcome: Debug, JSR223, OS Process, Java request, TCP, LDAP Extended, JDBC.
We've built a dummy custom component that simply prints some text in the JTL (much like a stripped version of a Debug Sampler) and produces same buggy behavior (I cannot share the code). I've tried to replicate with JMeter's default samplers and managed as detailed.
### Steps to reproduce the problem
Attaching sample JMX.
Ignore the failures at sampler level, they are irrelevant; the only thing to focus is the content of HTTP Headers listed in each Request Headers tab for HTTP Requests (the Request Assertion fails) -> you can see or not see the HTTP Headers defined in the HTTP Header Manager - (not) Local instances.
**Notes**:
1. I've used an Interleave Controller to prove that a Debug/LDAP Extended Sampler doesn't produce the issue.
2. I've used a Loop of 6 to prove that once JUnit sampler is executed then all future requests are plagued by the same outcome.
3. I've used a Module & Test fragment to suggest that issue can be easily buried under some re-used code/external code hence a rule like: 'don't use a HTTP Header Manager like this' can be easily lost from view. One can copy the whole code from the fragment and replace the Module controller and get same results.
### JMeter Version
5.5.1
### Java Version
openjdk version "17.0.9" 2023-10-17 OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9) OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)
### OS Version
Windows 11 Pro 22H2
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] HeaderManager in a loop is cleared from header definitions if some specific samplers are executed before [jmeter]
Posted by "matthewt-assurity (via GitHub)" <gi...@apache.org>.
matthewt-assurity commented on issue #6224:
URL: https://github.com/apache/jmeter/issues/6224#issuecomment-2785120594
I appear to be facing the same issue as you. In my case:
1. I have a Header Manager nested just underneath the Test Plan. This applies its headers to all samplers as expected.
2. I have a login API which returns a token, and this gets correlated in a JMeter variable.
3. I have another Header Manager nested underneath an API call that happens after login (and requires the token to authorize).
4. I have steps 1 - 3 in a thread group. I have set the thread group to run with 1 thread and 2 loops. The first loop works successfully, but on the second loop the headers from the second Header Manager are not being added to the API call after login.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] HeaderManager in a loop is cleared from header definitions if some specific samplers are executed before [jmeter]
Posted by "KingRabbid (via GitHub)" <gi...@apache.org>.
KingRabbid commented on issue #6224:
URL: https://github.com/apache/jmeter/issues/6224#issuecomment-1890085100
I can reproduce with JMeter 4.0.
Potentially [5897](https://github.com/apache/jmeter/issues/5897) is linked to this issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@jmeter.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org