Jmeter loop count - StackOverflowError:null

Jmeter loop count - StackOverflowError:null

我有以下测试计划

json 提取器和 post 处理器是因为我想处理分页并相应地增加页码。

第一个问题是,虽然我将线程组无限设置为 运行,但是当线程完成时它不会再次 运行,我得到以下错误。

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.WhosebugError: 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]

这可能与我的 while 循环有关吗?我在 while 循环中的条件是这样的 ${__groovy("false".equals(vars.get("isLast")))}

我注意到的另一个问题是,尽管我通过 GUI 指定了线程生命周期,但 jmeter 根本没有考虑到这一点(例如,当我生成示意图时)。

我不认为 CSV 文件是问题所在,因为我已经将 recycle on EOF 设置为 true,将 stop thread on EOF 设置为 false,将 sharing mode 设置为 Current thread group

线程在完成while循环后进入死循环。 当您离开 While 循环时,isLast 标志不会重置为 true。因此线程在第一次循环后永远不会进入while循环。

您可以在线程组结束时或进入 While 循环之前将标志重置为 true。

添加一个JSRS223采样器并添加以下内容

vars.put("isLast","false")
SampleResult.setIgnore()