Passing JVM arguments via maven plugin version 2.1

Hi Guys,

In my Gatling tests setup I use Maven profiles for executing different test types, by passing load characteristics to my script via JVM arguments in the pom.xml, for example:

<profile>
            <id>stresstest</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.klm.gatling</groupId>
                    <artifactId>gatling-klm</artifactId>
                </dependency>
            </dependencies>
            <properties>
                <profile-id>stresstest</profile-id>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.gatling</groupId>
                        <artifactId>gatling-maven-plugin</artifactId>
                        <configuration>
                            <dataFolder>src/test/resources/data</dataFolder>
                            <resultsFolder>target/gatling/results</resultsFolder>
                            <requestBodiesFolder>src/test/resources/request-bodies</requestBodiesFolder>
                            <simulationsFolder>src/test/scala</simulationsFolder>
                            <noReports>true</noReports>
                            <!--<reportsOnly>false</reportsOnly>-->
                            <simulationClass>com.klm.gatling.BrightIdeas</simulationClass>
                            <jvmArgs>
                                <jvmArg>-DstartRampUpUsersPerSec=${startRampUpLoad}</jvmArg>
                                <jvmArg>-DconstantUsersPerSec=${stressTestLoad}</jvmArg>
                                <jvmArg>-DrampUpPeriodSeconds=${stressTestRampUpDuration}</jvmArg>
                                <jvmArg>-DconstantUsersPerSecDuringSeconds=${stressTestDuration}</jvmArg>
                                <jvmArg>-Xms2g</jvmArg>
                                <jvmArg>-Xmx5g</jvmArg>
                            </jvmArgs>
                            <!--<fork>true</fork>-->
                            <propagateSystemProperties>true</propagateSystemProperties>
                            <!--<failOnError>true</failOnError>-->
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

Experimenting with Gatling version 2.1 I found this setup is not working anymore. I figured it has to do something with the fact Gatling doesn't compile the simulations anymore like described in https://github.com/gatling/gatling/blob/master/src/sphinx/project/migration_guides/2.0-to-2.1.rst. Unfortunately I lack the Maven knowledge to solve this without some help. Could someone please point me in the right direction? Much appreciated!

Cheers

Daniel

Hi Daniel,

Do you use the version 2.1.1 of the maven plugin too?

Cheers,

Stéphane

Hi Daniel,

This has nothing to do with the fact that Gatling doesn't compile the simulation itself anymore, since system properties are runtime parameters and not compile time parameters.

However, it can be a regression introduced by the major refactorings the Maven Plugin went under in 2.1.

I'll investigate.

Cheers,

Pierre

OK, I get it. Another missing stuff in the migration guide.

gatling-maven-plugin 2.1.X no longer has a jvmArgs configuration argument.
It now has:

   - zincJvmArgs that controls the JVM that compiles (you're not really
   supposed to touch this, but who knows)
   - gatlingJvmArgs that controls the JVM that runs

Set gatlingJvmArgs instead of jvmArgs.

@pdalpra: I think we should rename gatlingJvmArgs into jvmArgs ASAP. WDYT?

Renaming jvmArg did the trick, thanks for you reply!

Cheers

Daniel

We’ll revert to jvmArgs in upcoming 2.1.2: https://github.com/gatling/gatling/issues/2460

Thanks for reporting!

Cheers,
Stéphane