question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Issue]: Field list values with JMeter variables may be treated as sequence and field lists depending on the number of values

See original GitHub issue

What 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 value 1 which results in output 1
  • In the second iteration intFieldValueList is treated as field value list and the sequence values do not matter. The output is 5 and 6 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 is 2, even though 9 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:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
IsaUlloacommented, Jun 10, 2022

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.

1reaction
IsaUlloacommented, May 6, 2022

Hi @t-h-e ,

Thank you for you collaboration, we will look into it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found