Using foreach loop in Taurus file causes java.lang.StackOverflowError for jmeter executor

442 views
Skip to first unread message

Natallia Savelyeva

unread,
Jun 18, 2018, 10:06:10 AM6/18/18
to codename-taurus
Hello,

Could anyone please help me with the following issue?

I have created a simple taurus YAML file which uses a 'foreach' loop according to https://gettaurus.org/docs/JMeter/ documentation.

I am running this script locally via 'bzt plan.yml' inside alpine 3.7.0 container, java version is openjdk version "1.8.0_171"
OpenJDK Runtime Environment (IcedTea 3.8.0) (Alpine 8.171.11-r0)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)

Also, I tried to run the script in the cloud - same result: I am always getting 'o.a.j.JMeter: Uncaught exception: java.lang.StackOverflowError: null'.

So, the question is what should I change in the script or jmeter/java settings in order to use foreach loop in Taurus YAML file for jmeter 4.0 executor?

Please find plan.yaml, jmeter.log and other artifacts at https://drive.google.com/file/d/19NvPdUiL4yJe5KDWbHN0VfEzpIlr8xBK/view?usp=sharing.

For a quick look I paste content of plan.yaml here:
execution:
- concurrency: 10
  ramp-up: 2s
  hold-for: 30s
  scenario: simple 

scenarios:
  simple:
    variables:
      mypaths: ['1', '2'] 
    requests:
       # Note: in the below foreach-line I tried both: mypaths and ${mypaths} - result is same
       - foreach: mypath in mypaths
         do:
          - url: http://localhost:8080/${mypath}
            label: mypathtask
            method: POST
            body: '{"mypath": "${mypath}"}'

modules:
  jmeter:
    path: /tmp/apache-jmeter-4.0/bin/jmeter



Thank you in advance and have a nice day.

Andrey Pokhilko

unread,
Jun 18, 2018, 11:05:28 AM6/18/18
to codenam...@googlegroups.com

Hi,

Straightforward googling gives this explanation: https://stackoverflow.com/questions/46225081/stackoverflow-error-when-upgrading-to-jmeter-3-2

And it's not Taurus fault, it's inside JMeter itself. You can get JMX from artifacts and run it with bare JMeter. It should reproduce the same problem.

--

Andrey Pokhilko
Open Source Initiatives Leader
CA
          BlazeMeter

18.06.2018 17:06, Natallia Savelyeva пишет:
CAUTION: This email originated from outside of CA. Do not click links or open attachments unless you recognize the sender and know the content is safe.

--
You received this message because you are subscribed to the Google Groups "codename-taurus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codename-taur...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codename-taurus/569fa2bd-9dd8-4cda-9e68-01b670e96bc3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Natallia Savelyeva

unread,
Jun 18, 2018, 2:55:06 PM6/18/18
to codename-taurus
Hi Andrey,

Thank you for your reply.
Previously I also saw that stackoverflow post you mentioned, but I did not pay enough attention to it since it called javascript function which is not used in my taurus file.
And thanks to your hint I managed to implement a workaround using javascript-function.
Hovewer, this is still a workaround, it would be right to keep foreach loop in taurus yaml instead of javascript function, but this is a separate story for jmeter, not for taurus.

The corrected version of my draft taurus file now looks like this:

execution:
- concurrency: 10
  ramp-up: 2s
  hold-for: 30s
  scenario: simple

scenarios:
  simple:
    variables:
       mypaths: ["path1", "path2"]
    requests:
       - set-variables:
           mypath: ${__javaScript(${mypaths}[Math.floor(Math.random()*${mypaths}.length)])}

         label: mypathtask
         method: POST
         body: '{"mypath": "${mypath}"}'

modules:
  jmeter:
    path: /tmp/apache-jmeter-4.0/bin/jmeter



Finally, I checked jmeter logs with enabled debug logging (<Logger name="org.apache.http" level="debug" /> in apache-jmeter-4.0/bin/log4j2.xml) -
indeed, URLs and bodies are sent correctly and there are no any exceptions.
Reply all
Reply to author
Forward
0 new messages