I have the following test plan
- thread-group ( threads: "1", loops: "-1", ramp-up: "1" )
- http request defaults (i.e url)
- csv data set config (containing 4 lines of input data)
- user defined variables (initialize variables e.g isLast=false)
- simple controller
- while controller
- http request
- json extractor
- json extractor
- JSR233 PostProcessor
- http request
- while controller
The json extractor and post processor are because i want to handle pagination and increment the page number accordingly.
The first issue is that although i set up the thread-group to run infinitely, when the thread finishes it does not run again and i get the following error.
021-08-27 14:15:38,686 INFO o.a.j.e.J.increment page: isLast = true
2021-08-27 14:15:38,738 INFO o.a.j.t.JMeterThread: Thread finished: dba-data-exporter-users 1-1
2021-08-27 14:15:38,738 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[dba-data-exporter-users 1-1,6,main]
java.lang.StackOverflowError: null
at java.lang.Module.isExported(Module.java:456) ~[?:?]
at jdk.internal.reflect.Reflection.verifyModuleAccess(Reflection.java:212) ~[?:?]
at jdk.internal.reflect.Reflection.verifyMemberAccess(Reflection.java:125) ~[?:?]
at java.lang.reflect.AccessibleObject.slowVerifyAccess(AccessibleObject.java:633) ~[?:?]
at java.lang.reflect.AccessibleObject.verifyAccess(AccessibleObject.java:626) ~[?:?]
at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:590) ~[?:?]
at java.lang.reflect.Constructor.newInstance(Constructor.java:481) ~[?:?]
at org.codehaus.groovy.runtime.InvokerHelper.newScript(InvokerHelper.java:503) ~[groovy-3.0.7.jar:3.0.7]
at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:461) ~[groovy-3.0.7.jar:3.0.7]
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:266) ~[groovy-jsr223-3.0.7.jar:3.0.7]
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:155) ~[groovy-jsr223-3.0.7.jar:3.0.7]
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233) ~[java.scripting:?]
at org.apache.jmeter.functions.Groovy.execute(Groovy.java:120) ~[ApacheJMeter_functions.jar:5.4.1]
at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:138) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.engine.util.CompoundVariable.execute(CompoundVariable.java:113) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.testelement.property.FunctionProperty.getStringValue(FunctionProperty.java:100) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.control.WhileController.getCondition(WhileController.java:142) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.control.WhileController.endOfLoop(WhileController.java:62) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.control.WhileController.next(WhileController.java:112) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:222) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.control.GenericController.next(GenericController.java:175) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:222) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.control.GenericController.next(GenericController.java:175) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.control.LoopController.next(LoopController.java:134) ~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.control.LoopController.nextIsNull(LoopController.java:166) ~[ApacheJMeter_core.jar:5.4.1]
Is it something that has to do with my while loop maybe? The condition i have in my while loop is this
${__groovy("false".equals(vars.get("isLast")))}
The other issue that i have noticed, is that although i specify thread lifetime through the GUI, jmeter does not take that in to account at all (while i generate the schematic view for example).
I don't believe that CSV file is the issue, since i have already set recycle on EOF to true, stop thread on EOF to false and sharing mode to Current thread group

Groovyfunction is fine. Can you debug the script with the Step-by-step debugger? Also, change the While controller to a simple controller and see if the script works for one iteration. The test duration should work when you set theloop countto infinite (check of -1) , checkSpecify Thread Lifetimeand Duration. - Janesh Kodikara