Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customPropertiesFile properties are not being sent to slave machines #383

Open
venkatesan255 opened this issue Aug 11, 2020 · 8 comments
Open
Assignees

Comments

@venkatesan255
Copy link

venkatesan255 commented Aug 11, 2020

Version details
Jmeter version 5.3
Jmeter-Maven -Plugin version - 3.1.0
Java version 8

What should have happen
The plugin should copy all the properties to slave machine as well
What happened
The property file is applied only on master. it did not forwarded to slave

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.test</groupId>
    <artifactId>cora-nft-test-scripts</artifactId>
    <version>1.0</version>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <!-- Generate JMeter configuration -->
                    <execution>
                        <id>configuration</id>
                        <goals>
                            <goal>configure</goal>
                        </goals>
                    </execution>
                    <!-- Run JMeter tests -->
                    <execution>
                        <id>jmeter-tests</id>
                        <goals>
                            <goal>jmeter</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <testFilesIncluded>
                        <jMeterTestFile>**/${jmeterScript}.jmx</jMeterTestFile>
                    </testFilesIncluded>
                    <propertiesGlobal> <!-- to send the properties to slave machines as well -->
                        <runID>${runID}</runID>
                    </propertiesGlobal>
                    <propertiesUser> <!-- to send the properties to master machines alone -->
                        <runID>${runID}</runID>
                    </propertiesUser>

                    <generateReports>true</generateReports>
                    <jmeterExtensions>
                        <artifact>kg.apc:jmeter-plugins-standard:1.4.0</artifact>
                        <artifact>kg.apc:jmeter-plugins-prmctl:jar:0.4</artifact>
                        <artifact>io.github.delirius325:jmeter.backendlistener.elasticsearch:jar:2.6.8</artifact>
                    </jmeterExtensions>
                    <testPlanLibraries>
                        <artifact>com.nimbusds:nimbus-jose-jwt:jar:8.19</artifact>
                    </testPlanLibraries>

                <customPropertiesFiles>  
                    <file>${propertyFile}.properties</file>
                </customPropertiesFiles>

                </configuration>
            </plugin>
        </plugins>
    </build>
</project>



@Ardesco
Copy link
Contributor

Ardesco commented Aug 12, 2020

So is the issue here that global properties are not being sent out to the slaves? If so it sounds like a JMeter bug at first glance.

We supply a list of global properties to the JMeter command line using the -G flag, as part of your build you will see the following line in the console:

[INFO] Arguments for forked JMeter JVM: [<LIST_OF_ARGUMENTS>]

You should see something in there along the lines of -GrunID=<SUPPLIED_RUN_ID>Can you supply your console log so that we can confirm that you are seeing behaviour as specified above.

@Ardesco Ardesco self-assigned this Aug 12, 2020
@venkatesan255
Copy link
Author

venkatesan255 commented Aug 14, 2020

PFB logs.

C:\Venkat\SVN\Mobile>

mvn clean verify -DjmeterScript=NFT_TEST -Dinjectors=11.17.xx.xx -DpropertyFile=NFTSanity -DrunID=TEST_0010

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< com.test.nft:Mobile >------------------------
[INFO] Building Mobile 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Mobile ---
[INFO] Deleting C:\Venkat\SVN\Mobile\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Mobile ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Mobile ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- jmeter-maven-plugin:3.1.0:configure (configuration) @ Mobile ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] C O N F I G U R I N G    J M E T E R
[INFO] -------------------------------------------------------
[INFO]
[INFO] Building JMeter directory structure...
[INFO] Generating JSON Test config...
[INFO] Configuring JMeter artifacts...
[INFO] Populating JMeter directory...
[INFO] Copying extensions to C:\Venkat\SVN\Mobile\target\2c047242-7a48-4c9a-ae35-a228f8020a33\jmeter\lib\ext
Downloading dependencies: true
[INFO] Copying junit libraries to C:\Venkat\SVN\Mobile\target\2c047242-7a48-4c9a-ae35-a228f8020a33\jmeter\lib\junit
Downloading dependencies: true
[INFO] Copying test plan libraries to C:\Venkat\SVN\Mobile\target\2c047242-7a48-4c9a-ae35-a228f8020a33\jmeter\lib
Downloading dependencies: true
[INFO] Configuring JMeter properties...
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Mobile ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Venkat\SVN\Mobile\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ Mobile ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ Mobile ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ Mobile ---
[INFO] Building jar: C:\Venkat\SVN\Mobile\target\Mobile-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- jmeter-maven-plugin:3.1.0:jmeter (jmeter-tests) @ Mobile ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  P E R F O R M A N C E    T E S T S
[INFO] -------------------------------------------------------
[INFO]
[INFO] Will generate HTML report in C:\Venkat\SVN\Mobile\target\jmeter\reports\NFT_TEST
[INFO] Executing test: NFT_TEST.jmx
[INFO] Arguments for forked JMeter JVM: [java, -Xms512M, -Xmx4096M, -Djava.awt.headless=true, -jar, ApacheJMeter-5.3.jar, -d, C:\Venkat\SVN\Mobile\target\2c047242-7a48-4c9a-ae35-a228
f8020a33\jmeter, -e, -j, C:\Venkat\SVN\Mobile\target\jmeter\logs\NFT_TEST.jmx.log, -l, C:\Venkat\SVN\Mobile\target\jmeter\results\20200814-NFT_TEST.csv, -n, -o, C:\Venkat\SVN\eQMob
ile\target\jmeter\reports\NFT_TEST, -q, C:\Venkat\SVN\Mobile\NFTSanity.properties, -r, -t, C:\Venkat\SVN\Mobile\target\jmeter\testFiles\NFT_TEST.jmx, -R, 11.17.xx.xx, -Dsun.net.h
ttp.allowRestrictedHeaders, true, -GrunID=TEST_0010]
[INFO]
[INFO] SLF4J: Class path contains multiple SLF4J bindings.
[INFO] SLF4J: Found binding in [jar:file:/C:/Venkat/SVN/Mobile/target/2c047242-7a48-4c9a-ae35-a228f8020a33/jmeter/lib/log4j-slf4j-impl-2.13.1.jar!/org/slf4j/impl/StaticLoggerBinder.c
lass]
[INFO] SLF4J: Found binding in [jar:file:/C:/Venkat/SVN/Mobile/target/2c047242-7a48-4c9a-ae35-a228f8020a33/jmeter/lib/slf4j-nop-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[INFO] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[INFO] SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
[INFO] Aug 14, 2020 9:07:18 PM java.util.prefs.WindowsPreferences <init>
[INFO] WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[INFO] Creating summariser <summary>
[INFO] Created the tree successfully using C:\Venkat\SVN\Mobile\target\jmeter\testFiles\NFT_TEST.jmx
[INFO] Configuring remote engine: 11.17.xx.xx
[INFO] Starting distributed test with remote engines: [11.17.xx.xx] @ Fri Aug 14 21:07:19 BST 2020 (1597435639047)
[INFO] Remote engines have been started:[11.17.xx.xx]
[INFO] Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445
[INFO] summary =      3 in 00:00:01 =    2.3/s Avg:   209 Min:   161 Max:   287 Err:     0 (0.00%)
[INFO] Tidying up remote @ Fri Aug 14 21:07:21 BST 2020 (1597435641942)
[INFO] ... end of run
[INFO] Completed Test: C:\Venkat\SVN\Mobile\target\jmeter\testFiles\NFT_TEST.jmx
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  15.545 s
[INFO] Finished at: 2020-08-14T21:07:28+01:00
[INFO] ------------------------------------------------------------------------
[INFO] Shutdown detected, destroying JMeter process...
[INFO]

C:\Venkat\SVN\Mobile>


property File details

nrThreads_registration=2
rampUpTime_registration=1
loopCount_registration=2
durationSecond_registration=200
pacingTime_registration=40

nrThreads_login=2
rampUpTime_login=1
loopCount_login=2
durationSecond_login=200
pacingTime_login=20

nrThreads_authorise=2
rampUpTime_authorise=1
loopCount_authorise=2
durationSecond_authorise=200
pacingTime_authorise=30

below is the log from slave machine

2020-08-14 21:07:19,983 INFO o.a.j.s.FileServer: Default base='D:\Tools\Jmeter\apache-jmeter-5.3\bin'
2020-08-14 21:07:19,988 INFO o.a.j.s.FileServer: Set new base='.'
2020-08-14 21:07:19,994 INFO o.a.j.e.StandardJMeterEngine: Applying properties {runID=TEST_0010}
2020-08-14 21:07:19,995 INFO o.a.j.e.RemoteJMeterEngineImpl: Running test
2020-08-14 21:07:19,998 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2020-08-14 21:07:19,999 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2020-08-14 21:07:20,006 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must contain the string: '.functions.'
2020-08-14 21:07:20,006 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must not contain the string: '.gui.'
2020-08-14 21:07:20,613 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : 01_MOBILE_REGISTRATION_TEST_0010
2020-08-14 21:07:20,613 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group 01_MOBILE_REGISTRATION_TEST_0010.
2020-08-14 21:07:20,613 INFO o.a.j.e.StandardJMeterEngine: Thread will start next loop on error
2020-08-14 21:07:20,613 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2020-08-14 21:07:20,617 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2020-08-14 21:07:20,617 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 2 : 02_MOBILE_LOGIN_TEST_0010
2020-08-14 21:07:20,617 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group 02_MOBILE_LOGIN_TEST_0010.
2020-08-14 21:07:20,617 INFO o.a.j.e.StandardJMeterEngine: Thread will start next loop on error
2020-08-14 21:07:20,617 INFO o.a.j.t.ThreadGroup: Starting thread group... number=2 threads=1 ramp-up=1 delayedStart=false
2020-08-14 21:07:20,617 INFO o.a.j.t.ThreadGroup: Started thread group number 2
2020-08-14 21:07:20,618 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 3 : 03_MOBILE_AUTHORISE_TEST_0010
2020-08-14 21:07:20,618 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group 03_MOBILE_AUTHORISE_TEST_0010.
2020-08-14 21:07:20,618 INFO o.a.j.e.StandardJMeterEngine: Thread will start next loop on error
2020-08-14 21:07:20,618 INFO o.a.j.t.ThreadGroup: Starting thread group... number=3 threads=1 ramp-up=1 delayedStart=false
2020-08-14 21:07:20,619 INFO o.a.j.t.ThreadGroup: Started thread group number 3
2020-08-14 21:07:20,619 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started

in the above logs, threads count, ramp up properties are not applied from property file on slave machine.

@Ardesco
Copy link
Contributor

Ardesco commented Aug 17, 2020

That all looks to be working correctly, the global properties are being applied to the secondary as per:

2020-08-14 21:07:19,994 INFO o.a.j.e.StandardJMeterEngine: Applying properties {runID=TEST_0010}

Only global properties will be passed down to secondaries.

@venkatesan255
Copy link
Author

venkatesan255 commented Aug 17, 2020

Yes I get that. But I wanted to apply the properties from customProperty file to all the slaves. How can I do that ?

@Ardesco
Copy link
Contributor

Ardesco commented Aug 18, 2020

JMeter doesn't support that as far as I'm aware, it only passes global properties through to the secondary.

It sounds like what you really want this: #35

@Ardesco
Copy link
Contributor

Ardesco commented Aug 18, 2020

You can of course use the plugin to start up the secondary instances, then it will be configured in the same way as the master, the following IT POM may provide some guidance:

https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/blob/master/src/it/remote-test/pom.xml

@venkatesan255
Copy link
Author

venkatesan255 commented Mar 7, 2021

I've tried the above pom xml. however it did not send the properties to slave machines. also noticed one more point with above pom.xml . It is trying to configure localhost as remote server automatically. Similar to this, is there any way to start the remote servers on slave machines ?

@Ardesco
Copy link
Contributor

Ardesco commented Mar 8, 2021

It is not possible to configure the plugin to arbitrarily run commands upon another machine to start up a JMeter server instance.

You would need to run your project on that other machine to start up a JMeter instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants