I don't know how to switch the `gatling.conf` file being used by utilizing the `gatling.conf.file` system property

Gatling version: 3.14.9
Gatling flavor: java kotlin scala javascript typescript
Gatling build tool: maven gradle sbt bundle npm

I made sure I’ve update my Gatling version to the latest release
I read the guidelines and how to ask a question topics.
I provided a SSCCE (or at least, all information to help the community understand my topic)
I copied output I observe, and explain what I think should be.

Hello,

I have a question about passing `gatling.conf.file` when using gatling-maven-plugin.

I copied gatling.conf, created gatling-special.conf with percentile2 set to 90, and placed it at src\test\resources\gatling-special.conf.

I executed the BasicSimulation included in the bundle by specifying the system property -Dgatling.conf.file=gatling-special.conf with the following command.

.\mvnw.cmd gatling:test “-Dgatling.simulationClass=example.BasicSimulation” “-Dgatling.conf.file=gatling-special.conf”

Since “75th” is output to the console instead of “90th”, gatling-special.conf is not being used.

response time 75th percentile (ms) | 4,349 | 4,349 |

I added code to src\test\java\example\BasicSimulation.java to output the system properties gatling.simulationClass, gatling.conf.file, and paramX, as shown below.

public class BasicSimulation extends Simulation {
{ System.out.println(“gatling.simulationClass=”+System.getProperty(“gatling.simulationClass”)) ;
System.out.println(“gatling.conf.file=”+System.getProperty(“gatling.conf.file”)) ;
System.out.println(“paramX=”+System.getProperty(“paramX”)) ;
}

// omission
}

I added “-DparamX=12345” to the previous command and executed BasicSimulation.

.\mvnw.cmd gatling:test “-Dgatling.simulationClass=example.BasicSimulation” “-Dgatling.conf.file=gatling-special.conf” “-DparamX=12345”

The following is output to the console, and it appears that the values ​​of system properties starting with “gatling.” are not being passed to the Gatling process.

gatling.simulationClass=null
gatling.conf.file=null
paramX=12345

When using the gatling-maven-plugin, how should I pass the gatling.conf.file system property?

Thank you.

Hello,

You’re not passing Java System properties the right way, you shouldn’t wrap them with double quotes.

Thanks for your response.

I ran the simulation without enclosing it in double quotes, as you suggested.
However, the result was the same: the file specified in gatling.conf.file was not loaded,
and the percentile2 value remained at the default of 75 (it did not change to 90).

Command:

.\mvnw.cmd gatling:test -Dgatling.simulationClass=example.BasicSimulation -Dgatling.conf.file=gatling-special.conf -DparamX=12345

Console:

gatling.simulationClass=null
gatling.conf.file=null
paramX=12345

// omission

response time 50th percentile (ms) | 4,880 | 4,880 | -
response time 75th percentile (ms) | 4,880 | 4,880 | -
response time 95th percentile (ms) | 4,880 | 4,880 | -
response time 99th percentile (ms) | 4,880 | 4,880 | -

For the sake of verification, I ran the following on Linux using the same bundled assets; however,
the file specified in gatling.conf.file was not loaded,
and the percentile2 value remained at the default of 75 (it did not change to 90).

./mvnw gatling:test -Dgatling.simulationClass=example.BasicSimulation -Dgatling.conf.file=gatling-special.conf -DparamX=12345

Regardless of whether or not they are enclosed in quotes,
it still appears that system properties starting with “gatling.”
are not being passed to the Gatling process.

There was a regression in the gatling-maven-plugin. Please upgrade to 4.21.12.

I have confirmed that by upgrading the gatling-maven-plugin to version 4.21.12, it is possible to specify a configuration file via gatling.conf.file.

Thank you.