Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThroughputController: StackOverFlowError triggered when throughput=0 (Total Executions or Percentage Executions) #4682

Closed
asfimport opened this issue Jan 30, 2018 · 4 comments

Comments

@asfimport
Copy link
Collaborator

Artem Fedorov (Bug 62062):
When I ran the following Test Plan I got the java.lang.StackOverflowError

  • innerLoop
    • ThroughputController (sut)
      • sampler one
      • sampler two

...
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:222)
at org.apache.jmeter.control.GenericController.next(GenericController.java:173)
at org.apache.jmeter.control.LoopController.next(LoopController.java:128)
at org.apache.jmeter.control.LoopController.nextIsNull(LoopController.java:163)
at org.apache.jmeter.control.GenericController.next(GenericController.java:168)
at org.apache.jmeter.control.LoopController.next(LoopController.java:128)
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:222)
at org.apache.jmeter.control.GenericController.next(GenericController.java:173)
at org.apache.jmeter.control.LoopController.next(LoopController.java:128)
at org.apache.jmeter.control.LoopController.nextIsNull(LoopController.java:163)
at org.apache.jmeter.control.GenericController.next(GenericController.java:168)
at org.apache.jmeter.control.LoopController.next(LoopController.java:128)
at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:222)
at org.apache.jmeter.control.GenericController.next(GenericController.java:173)
...

Created attachment stackoverflow_threadgroup.jmx: Test plan that reproduces this bug

stackoverflow_threadgroup.jmx
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="4.0" jmeter="4.0-SNAPSHOT.20180130">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
      <stringProp name="TestPlan.comments"></stringProp>
      <boolProp name="TestPlan.functional_mode">false</boolProp>
      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
        <collectionProp name="Arguments.arguments"/>
      </elementProp>
      <stringProp name="TestPlan.user_define_classpath"></stringProp>
    </TestPlan>
    <hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <intProp name="LoopController.loops">-1</intProp>
        </elementProp>
        <stringProp name="ThreadGroup.num_threads">1</stringProp>
        <stringProp name="ThreadGroup.ramp_time">1</stringProp>
        <longProp name="ThreadGroup.start_time">1517235748000</longProp>
        <longProp name="ThreadGroup.end_time">1517235748000</longProp>
        <boolProp name="ThreadGroup.scheduler">false</boolProp>
        <stringProp name="ThreadGroup.duration"></stringProp>
        <stringProp name="ThreadGroup.delay"></stringProp>
      </ThreadGroup>
      <hashTree>
        <ThroughputController guiclass="ThroughputControllerGui" testclass="ThroughputController" testname="Throughput Controller" enabled="true">
          <intProp name="ThroughputController.style">0</intProp>
          <boolProp name="ThroughputController.perThread">false</boolProp>
          <intProp name="ThroughputController.maxThroughput">0</intProp>
          <FloatProperty>
            <name>ThroughputController.percentThroughput</name>
            <value>1.0</value>
            <savedValue>0.0</savedValue>
          </FloatProperty>
        </ThroughputController>
        <hashTree>
          <DebugSampler guiclass="TestBeanGUI" testclass="DebugSampler" testname="Debug Sampler" enabled="true">
            <boolProp name="displayJMeterProperties">false</boolProp>
            <boolProp name="displayJMeterVariables">true</boolProp>
            <boolProp name="displaySystemProperties">false</boolProp>
          </DebugSampler>
          <hashTree/>
        </hashTree>
      </hashTree>
      <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
        <boolProp name="ResultCollector.error_logging">false</boolProp>
        <objProp>
          <name>saveConfig</name>
          <value class="SampleSaveConfiguration">
            <time>true</time>
            <latency>true</latency>
            <timestamp>true</timestamp>
            <success>true</success>
            <label>true</label>
            <code>true</code>
            <message>true</message>
            <threadName>true</threadName>
            <dataType>true</dataType>
            <encoding>false</encoding>
            <assertions>true</assertions>
            <subresults>true</subresults>
            <responseData>false</responseData>
            <samplerData>false</samplerData>
            <xml>false</xml>
            <fieldNames>true</fieldNames>
            <responseHeaders>false</responseHeaders>
            <requestHeaders>false</requestHeaders>
            <responseDataOnError>false</responseDataOnError>
            <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
            <assertionsResultsToSave>0</assertionsResultsToSave>
            <bytes>true</bytes>
            <sentBytes>true</sentBytes>
            <threadCounts>true</threadCounts>
            <idleTime>true</idleTime>
            <connectTime>true</connectTime>
          </value>
        </objProp>
        <stringProp name="filename"></stringProp>
      </ResultCollector>
      <hashTree/>
    </hashTree>
  </hashTree>
</jmeterTestPlan>

Severity: normal
OS: All

@asfimport
Copy link
Collaborator Author

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Author: pmouawad
Date: Tue Jan 30 21:38:15 2018
New Revision: 1822704

URL: http://svn.apache.org/viewvc?rev=1822704&view=rev
Log:
#4682 - ThroughputController: StackOverFlowError triggered when throughput=0 (Total Executions or Percentage Executions)
This closes #373
Partly contributed by Artem Fedorov
#4682

Modified:
jmeter/trunk/src/components/org/apache/jmeter/control/ThroughputController.java
jmeter/trunk/test/src/org/apache/jmeter/control/ThroughputControllerSpec.groovy
jmeter/trunk/xdocs/changes.xml

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Thanks for report and PR.
I amended the fix to also handle SO if Percentage=0

Please test and confirm fix is ok for you.
Regards

@asfimport
Copy link
Collaborator Author

Artem Fedorov (migrated from Bugzilla):
This fix works for me

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant