2
votes

Dear community.

I have one question relating distributed testing using JMeter (Master -> Slave 1, ... Slave N).

I created a simple test plan (*.jmx) and I want to execute same test plan with different properties which should be read from user.properties.

For example:

  • user20threads.properties has threads=20, rampup=30
  • user30threads.properties has threads=60, rampup=60.

In test plan (*.jmx) I tried to define threads dynamically by:

  • ${threads},
  • ${__P(threads)},
  • ${__property(threads)} .

enter image description here

No one of them worked. The value from user.properties is read and submitted to slaves successfully as I see those properties in the log file of slave:

... log lines omitted ...
2014/10/15 15:46:29 INFO  - jmeter.engine.StandardJMeterEngine: Applying properties {rampup=30, threads=20, ... other properties omitted ...} 
... log lines omitted ...

But due any reasons the slave is not recognizing property and therefore the testplan is executed with threads=0 and rampup=0. What I expect is threads=20 and rampup=30.

... log lines omitted ...
2014/10/15 15:46:30 INFO  - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 0 ramp-up 0 perThread NaN delayedStart=false 
... log lines omitted ...

Not sure if it is relevant, but here how JMeter master and slaves are started:

Master:

java -server -jar $HOME/ApacheJMeter.jar -n -R "localhost:2011,localhost:2012" -X -j jmeter-master.log -l master.log -Guser20threads.properties -t testplan.jmx

Slave:

java -server -jar $HOME/ApacheJMeter.jar -Dserver_port=2011 -s -d result -j jmeter-slave-2011.log
java -server -jar $HOME/ApacheJMeter.jar -Dserver_port=2012 -s -d result -j jmeter-slave-2012.log

Can you please tell me what I am doing wrongly?

Thank you - Chris

1
First try to set it up using default property files. ${__P(threads)} and ${__property(threads)} are used to get the property value, ${threads} is trying to use a variable, which is different and not being set. I think using -G option may be the problem. Try setting the values in your master user.properties file as well as the global file (globals only seems to affect remotes, not master). However, because everything is on localhost same folder, your user.properties will be shared with the slaves already, so putting the values in there might mask the global issue, rather than resolve it.CharlieS
is it your intention to have different threads/rampup on each slave?CharlieS
Hi CharlieS. All slaves should have same threads/rampup. I found my issue yesterday, it was because of wrong -d parameter. I thought -d parameter is used as home to point the results here but in case the JMETER home should be used. Leaving away the -d parameter solved my issue.pitschr
glad you worked it out, i didn't even notice the -d parm on slavesCharlieS

1 Answers

0
votes

You need to have the property files in the slave machines as well!! Do you have them in the expected path? You can pass properties as name value pair to slaves directly from master. Not the file name! In this case it expects the file to be present in the slave as well.