[Issue]: Field list values with JMeter variables may be treated as sequence and field lists depending on the number of values
See original GitHub issueWhat happened?
I noticed another bug in the seq
implementation in combination with JMeter variables.
Assume we have the following field value mapping:
data[${amount}].intFieldValueList | seq | 0 | [${intFieldValueList}]
Note that is now int rather than string.
Lets assume we have a loop around the KafkaSchemaSampler as in the example attached to this issue. The following table represents three iterations (each row is one iteration), and shows the values of the variables and the output.
${intFieldValueList} | ${amount} | output |
---|---|---|
1 | 1 | {“data”: [ { “intFieldValueList”: 1 } ] } |
5,6 | 2 | {“data”: [ { “intFieldValueList”: 5 }, { “intFieldValueList”: 6 } ] } |
9 | 1 | {“data”: [ { “intFieldValueList”: 2 } ] } |
The issue is the following.
- In the first iteration,
intFieldValueList
is treated as sequence with the start value1
which results in output1
- In the second iteration
intFieldValueList
is treated as field value list and the sequence values do not matter. The output is5
and6
as the field value list specifies two values that are used. - In the third iteration, the problem occurs as the field value list contains only a single value and therefore is treated as sequence again. As the previous values was
1
, the next is2
, even though9
was specified.
As suggested in another issue or PR, there should be a clearer distinction between sequence and field value list.
FieldValueListBug.jmx.txt FieldValueListBug.avsc.txt
KloadGen Version
4.0.9
Relevant log output
No response
Have you added your JMX Testplan or a replica?
- I have added a JMX testplan
Have you added your Schema or a replica?
- I have added the Schema
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
User's Manual: Functions and Variables - Apache JMeter
JMeter functions are special values that can populate fields of any Sampler ... Initial Sequence number (if omitted, the End sequence number is...
Read more >Apache JMeter - User's Manual: Functions and Variables
JMeter functions are special values that can populate fields of any Sampler or ... String, char, generate Unicode char values from a list...
Read more >User's Manual: Elements of a Test Plan - Apache JMeter
Variables don't have to vary - they can be defined once, and if left alone, will not change value. So you can use...
Read more >Component Reference - Apache JMeter - User's Manual
Several test elements use JMeter properties to control their behaviour. These properties are normally resolved when the class is loaded.
Read more >Apache JMeter - User's Manual: Functions and Variables
Functions and Variables¶. JMeter functions are special values that can populate fields of any Sampler or other element in a test tree.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @t-h-e ,
Since what you are trying to do is not compatible with our sequences logic, we decided to create a new field type called “Iterator”.
We are working on it, so soon we hope to have the problem solved.
Hi @t-h-e ,
Thank you for you collaboration, we will look into it.