apache / apache/jmeter

UDV defined in test plan failed to be expanded in distributed testing mode

Open
#5,294 13 comments 0 reactions 0 assignees View on GitHub
os: All P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**Owen** ([Bug 64367](https://bz.apache.org/bugzilla//show_bug.cgi?id=64367&redirect=false)):
I defined a UDV in root element of the test plan as follows:
name: BASE_FILENAME
value: ${__TestPlanName}_${__P(NUM_THREAD,0)}threads_${__P(NUM_LOOP,0)}trans_${__P(TPS_MIN,0)}tpm_${__Random(0,10000)}

There is a "Simple Data Writer" listener in the test plan which refer to the variable as a file name which saved requests and responses, I ran the test with following commands:
//local mode
jmeter.bat -n -t http_bing.jmx -l http_bing.csv -JNUM_THREAD=2 -JNUM_LOOP=5 -JTPS_MIN=1800 -JTIME_RAMPUP=1
//distributed mode, -R option follows two IP address of JMeter-server
jmeter.bat -n -t http_bing.jmx -l http_bing.csv -R "172.17.96.4,172.17.119.6" -GNUM_THREAD=2 -GNUM_LOOP=5 -GTPS_MIN=1800 -GTIME_RAMPUP=1

I found that the variable failed to be expanded in distributed testing mode and it produced a result file "${__TestPlanName}_${__P(NUM_THREAD,0)}threads_${__P(NUM_LOOP,0)}trans_${__P(TPS_MIN,0)}tpm_${__Random(0,10000)}.xml", but it was expanded successfully in local mode testing and produced a file http_bing.jmx_2threads_5trans_1800tpm_807.xml

I guess it may a bug in variable expansion.

JMeter version: 2.5.1
Java version: 1.8.0_161
OS version: windows 10
JMX file: see attachment http_bing.jmx

Created attachment [http_bing.jmx](https://apache.github.io/jmeter-bugzilla-attachments/67/64367/37184/http_bing.jmx): test plan
http_bing.jmx

````xml




false
true
false



NUM_THREAD
${__P(NUM_THREAD,1)}
=


NUM_LOOP
${__P(NUM_LOOP,1)}
=


TIME_RAMPUP
${__P(TIME_RAMPUP,1)}
=


TPS_MIN
${__P(TPS_MIN,60)}
=


BASE_FILENAME
${__TestPlanName}_${__P(NUM_THREAD,0)}threads_${__P(NUM_LOOP,0)}trans_${__P(TPS_MIN,0)}tpm_${__Random(0,10000)}
=







continue

false
${NUM_LOOP}

${NUM_THREAD}
${TIME_RAMPUP}
false


true






www.bing.com
80
http

/
GET
true
false
true
false






false

saveConfig


true
true
true
true
true
true
true
true
false
true
true
true
false
true
true
true
true
false
true
0
true
true
true
true
true


${BASE_FILENAME}.xml



4
${TPS_MIN}



false

saveConfig


true
true
true
true
true
true
true
true
false
true
true
false
false
false
true
false
false
false
true
0
true
true
true
true
true







````

Severity: normal
OS: All

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.