Gatling simulation not reproducible in container

357 views
Skip to first unread message

Stef Joosten

unread,
Jan 6, 2022, 7:40:46 AM1/6/22
to Gatling User Group
I'm trying to reproduce my gatling simulation inside a docker container. However I get different results.

Without containers I get a correct simulation, while using openjdk version "17.0.1" 2021-10-19 and gatling version 3.7.2:
```
GATLING_HOME is set to /Users/sjo00577/git/RAP/gatling-3-7-2
RAPtest is the only simulation, executing it.
Select run description (optional)
12:42:47.629 [WARN ] i.g.c.s.e.ElCompiler$ - You're still using the deprecated ${} pattern for Gatling EL. Please use to the #{} pattern instead.
n=67 offset=0 test=true char=/
n=67 offset=67 test=false char=/
n=83 offset=76 test=true char=/

<leaving out a large chunk of log file, picking up on results to show that it has worked>

================================================================================
2022-01-06 12:43:48 59s elapsed
---- Requests ------------------------------------------------------------------
> Global (OK=31 KO=1 )
> Home (OK=1 KO=0 )
> Home Redirect 1 (OK=1 KO=0 )
> polyfill.min.js (OK=1 KO=0 )
> ampersand.min.css?2007197015985610770 (OK=1 KO=0 )
> project.min.css?2007197015985610770 (OK=1 KO=0 )
> project.min.js?2007197015985610770 (OK=1 KO=0 )
> ampersand.min.js?2007197015985610770 (OK=1 KO=0 )
> lib.min.css?2007197015985610770 (OK=1 KO=0 )
> logo-ou.png (OK=1 KO=0 )

<leaving out a small chunk of log file, picking it up at the end to show that it terminates properly>

================================================================================

Reports generated in 0s.
Please open the following file: /Users/sjo00577/git/RAP/gatling-3-7-2/results/raptest-20220106114247711/index.html
```
However, the containerized version of the same script does not work. I am also using
openjdk:17.0.1 and gatling version 3.7.2. This is what I get:
```
RAP % docker compose logs test-elf -f
gatling  | GATLING_HOME is set to /opt/gatling
gatling  | OpenJDK 64-Bit Server VM warning: Option UseBiasedLocking was deprecated in version 15.0 and will likely be removed in a future release.
gatling  | RAPtest is the only simulation, executing it.
gatling  | Select run description (optional)
gatling  | 12:02:25.079 [ERROR] i.g.a.Gatling$ - Run crashed
gatling  | java.lang.NullPointerException: Cannot invoke "String.trim()" because the return value of "scala.io.StdIn$.readLine()" is null
gatling  |      at io.gatling.app.Selection$Selector.askRunDescription(Selection.scala:141)
gatling  |      at io.gatling.app.Selection$Selector.$anonfun$selection$5(Selection.scala:61)
gatling  |      at scala.Option.getOrElse(Option.scala:201)
gatling  |      at io.gatling.app.Selection$Selector.selection(Selection.scala:61)
gatling  |      at io.gatling.app.Selection$.apply(Selection.scala:36)
gatling  |      at io.gatling.app.Runner.run0(Runner.scala:61)
gatling  |      at io.gatling.app.Runner.run(Runner.scala:49)
gatling  |      at io.gatling.app.Gatling$.start(Gatling.scala:87)
gatling  |      at io.gatling.app.Gatling$.fromArgs(Gatling.scala:49)
gatling  |      at io.gatling.app.Gatling$.main(Gatling.scala:38)
gatling  |      at io.gatling.app.Gatling.main(Gatling.scala)
gatling  | Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.trim()" because the return value of "scala.io.StdIn$.readLine()" is null
gatling  |      at io.gatling.app.Selection$Selector.askRunDescription(Selection.scala:141)
gatling  |      at io.gatling.app.Selection$Selector.$anonfun$selection$5(Selection.scala:61)
gatling  |      at scala.Option.getOrElse(Option.scala:201)
gatling  |      at io.gatling.app.Selection$Selector.selection(Selection.scala:61)
gatling  |      at io.gatling.app.Selection$.apply(Selection.scala:36)
gatling  |      at io.gatling.app.Runner.run0(Runner.scala:61)
gatling  |      at io.gatling.app.Runner.run(Runner.scala:49)
gatling  |      at io.gatling.app.Gatling$.start(Gatling.scala:87)
gatling  |      at io.gatling.app.Gatling$.fromArgs(Gatling.scala:49)
gatling  |      at io.gatling.app.Gatling$.main(Gatling.scala:38)
gatling  |      at io.gatling.app.Gatling.main(Gatling.scala)
^C^CERRO[0168] got 3 SIGTERM/SIGINTs, forcing shutdown
```
I did several attempts:
* I used the gatling container denvazh/gatling, which runs gatling vs. 3.2.1.
* I also cloned the Dockerfile and changed it to work with gatling vs. 3.7.2.
* I also made my own Dockerfile, to ensure that I work with openjdk:17.0.1.

In all cases the results were identical, so the root cause of this problem might not be with versioning.
If anybody has some inspiration, I'd be very grateful.

Hicham Bellat

unread,
Jan 6, 2022, 8:45:47 AM1/6/22
to gat...@googlegroups.com
Hello,

How can I run with maven gatling:test  severals gatling tests ?

Many thanks

--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/64053dc3-1d70-4746-b40e-9f73afc899c5n%40googlegroups.com.

Stef Joosten

unread,
Jan 6, 2022, 9:29:24 AM1/6/22
to Gatling User Group
Dear hbe...@gmail.com, I have never worked with maven, so I don't know the answer to your question. My original question is about running gatling without containers (straight from the CLI of my laptop) versus running gatling from a docker container. In both cases without maven.
Yours,
Stef Joosten (stef.j...@gmail.com)

Op donderdag 6 januari 2022 om 14:45:47 UTC+1 schreef hbe...@gmail.com:
Reply all
Reply to author
Forward
0 new messages