apache / jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
https://jmeter.apache.org/
Apache License 2.0
8.25k stars 2.09k forks source link

Values of declared variables within the same User Defined Variables element are not evaluated #5487

Open asfimport opened 3 years ago

asfimport commented 3 years ago

eR@SeR (Bug 65072): Hello,

Values of declared variables within same User Defined Variables element are not evaluated in declared variables that are in rows below. Run provided jmx file and check the Sampler's name in VRT listener.

In results, variables var2 and var4 have values ${var1} and ${var3}, instead "doesn't work in var2, works in var7" and "works in var6 but doesn't work in var4 and var8" respectively.

As a workaround, Groovy function is used, so var6 properly generates assigned value within same UDV element.

Jmeter 5.4.1 7acd031 Microsoft Windows 10 Enterprise 64-bit java version "14.0.1" 2020-04-14

Created attachment UDVIssue.jmx: UDVIssue

UDVIssue.jmx ````xml false true false var1 doesn't work in var2, works in var7 = var2 ${var1} = var3 ${__groovy("works in var6 but doesn't work in var4 and var8",var5)} = var4 ${var3} = var6 ${var5} = var7 ${var1} = var8 ${var4} = continue false 1 1 1 false true false saveConfig true true true true true true true false true true false false false true false false false true 0 true true true true true true true true groovy true true groovy true true groovy true true groovy true true groovy true true groovy true true groovy true true groovy ````

Version: Nightly Severity: normal OS: All

asfimport commented 3 years ago

@FSchumacher (migrated from Bugzilla): The values in the User Defined Variables are evaluated in "random" order. They are - unlike properties - stored inside a hash and not an ordered collection.

I have no idea, why this choice has been made ages ago and am a bit hesitant to change it without more thought on the original reasoning.

asfimport commented 3 years ago

@FSchumacher (migrated from Bugzilla): This seems to be really close to https://github.com/apache/jmeter/issues/5132 (maybe we should link these two)

asfimport commented 3 years ago

eR@SeR (migrated from Bugzilla): (In reply to Felix Schumacher from comment 1)

The values in the User Defined Variables are evaluated in "random" order. They are - unlike properties - stored inside a hash and not an ordered collection.

I have no idea, why this choice has been made ages ago and am a bit hesitant to change it without more thought on the original reasoning. Hi Felix,

You can try to change it and send me the build so I can test it? Fix doesn't have to be in nightly before it is verified.

(In reply to Felix Schumacher from comment 2)

This seems to be really close to https://github.com/apache/jmeter/issues/5132 (maybe we should link these two) If you ask me, IDK. It might be. You can ask the author of the thread to check if/when the fix is released in nightly.