When starting a JMeter test with the jmeter-maven-plugin with the following configuration...
<project>
...
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>integration-test</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<customPropertiesFile>${basedir}/src/test/jmeter/jmeter.properties</customPropertiesFile>
<testFilesDirectory>${basedir}/src/test/jmeter</testFilesDirectory>
<remoteConfig>
<startServersBeforeTests>true</startServersBeforeTests>
<serverList>server01,server02</serverList>
<stopServersAfterTests>true</stopServersAfterTests>
</remoteConfig>
<testResultsTimestamp>false</testResultsTimestamp>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
...then the tests are executed properly on the given remote servers "server01" and "server02". The Maven task does not wait regarding the remote host's process but states that everything is fine:
[INFO] -------------------------------------------------------
[INFO] P E R F O R M A N C E T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO]
[INFO] Proxy server is not being used.
[debug] JMeter is called with the following command line arguments: -n -t /home/me/demo/src/test/jmeter/test.jmx -l /home/me/demo/target/jmeter/results/20130925-test.jtl -d /home/me/demo/target/jmeter -q /home/me/demo/src/test/jmeter/jmeter.properties -r -R server01,server02 -X
[info] Executing test: test.jmx
[info] Completed Test: test.jmx
[INFO]
[INFO] Test Results:
[INFO]
[INFO] Tests Run: 1, Failures: 0
[INFO]
[INFO]
[INFO] --- maven-failsafe-plugin:2.15:verify (verify)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.598s
[INFO] Finished at: Wed Sep 25 16:43:00 CEST 2013
[INFO] Final Memory: 21M/349M
[INFO] ------------------------------------------------------------------------
But there aren't any test results collected. If you check the appropriate JMeter result's file then you'll realize an empty one:
cat /home/me/demo/target/jmeter/results/20130925-test.jtl
#empty
So the Maven process is finished before the remote servers have finalized the test execution. Am I wrong to expect that the jmeter-maven-plugin should collect the test results of the remote hosts instead of writing a 0 byte file (20130925-test.jtl)?
If I start the same test without using remote JMeter agents then everything works fine. The jmeter-maven-plugin executes the test and writes the result in the according "jtl" file. So what could be wrong with the above configuration regarding the "remoteConfig" element?
UPDATE 1: I used the jmeter-maven-plugin version 1.8.1 and Maven 3.0.5
UPDATE 2: The example above executed just 1 JMeter test. If there are more than 1 JMeter test in the directory ${basedir}/src/test/jmeter then the Maven build fails. In this case the log file of the first JMeter test has no errors but all other test logs (e.g. ./target/jmeter/logs/test2.log) state the following message:
Error in NonGUIDriver java.lang.IllegalStateException: Engine is busy - please try later
So the 1st test was executed on the remote agent (also without collecting any results in the according "jtl" file on the client site) but the other tests have been denied by the remote hosts. So it seems that the maven-jmeter-plugin tries to parallelize the execution of the tests but IMHO they should be executed in a serialized way.