Xarx123
11 years agoOccasional Contributor
tc.run() does not function in load tests
SoapUI v.4.6.1 x64 (the newest, but the same was in 4.6.0) on Windows 7 x64.
I have a simple sample (see attachments) demonstrating that running another TestCase from groovy script via tc.run() behaves strangely in load tests. Strange groovy errors occur even in the simplest situation, and moreover the execution environment becomes unstable (in a sense).
I have a TestCase containing this groovy script:
The other TestCase "TestCase - Proc" contains this groovy script:
That's all.
1. When executed from a load test in at least two threads, the following errors occur in the error log in about 3% of Total Runs:
2. When executing the load test for several times (and making some editations in between, maybe), the error log contains this error instead:
When running the "TestCase - Proc" from the ordinary Run TestCase step, the errors do not occur.
3. Moreover, after several executions of the load test, I cannot edit the script code of "TestCase - Proc", the groovy script editor is in read-only mode. I have to exit and restart SoapUI after that. The explanation is shown in the SoapUI exit dialog: The TestCase is still considered running ("Exit SoapUI? Projects with running tests will not be saved.")
All in all, tc.run() is currently unusable from load tests.
I have a simple sample (see attachments) demonstrating that running another TestCase from groovy script via tc.run() behaves strangely in load tests. Strange groovy errors occur even in the simplest situation, and moreover the execution environment becomes unstable (in a sense).
I have a TestCase containing this groovy script:
def tc = testRunner.testCase.testSuite.testCases["TestCase - Proc"]
def runner = tc.run(null, false )
The other TestCase "TestCase - Proc" contains this groovy script:
def c = context
That's all.
1. When executed from a load test in at least two threads, the following errors occur in the error log in about 3% of Total Runs:
Sat Nov 02 18:40:37 CET 2013:ERROR:groovy.lang.MissingPropertyException: No such property: context for class: Script1
groovy.lang.MissingPropertyException: No such property: context for class: Script1
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at Script1.run(Script1.groovy:1)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:149)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:239)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:148)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:43)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:77)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:640)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:73)
at com.eviware.soapui.model.testsuite.TestCase$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at com.eviware.soapui.model.testsuite.TestCase$run.call(Unknown Source)
at Script1.run(Script1.groovy:4)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:149)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:239)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:148)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:43)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at com.eviware.soapui.impl.wsdl.loadtest.WsdlLoadTestRunner$InternalTestCaseRunner.run(WsdlLoadTestRunner.java:544)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2. When executing the load test for several times (and making some editations in between, maybe), the error log contains this error instead:
Sat Nov 02 18:38:53 CET 2013:ERROR:java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.eviware.soapui.impl.wsdl.panels.support.TestRunComponentEnabler.enable(TestRunComponentEnabler.java:80)
at com.eviware.soapui.impl.wsdl.panels.support.TestRunComponentEnabler.testCaseFinished(TestRunComponentEnabler.java:107)
at com.eviware.soapui.monitor.TestMonitor.notifyTestCaseFinished(TestMonitor.java:154)
at com.eviware.soapui.monitor.TestMonitor$InternalTestRunListener.afterRun(TestMonitor.java:294)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.notifyAfterRun(AbstractTestCaseRunner.java:301)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalFinally(AbstractTestCaseRunner.java:191)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalFinally(AbstractTestCaseRunner.java:43)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:163)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:77)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:640)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:73)
at com.eviware.soapui.model.testsuite.TestCase$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at com.eviware.soapui.model.testsuite.TestCase$run.call(Unknown Source)
at Script1.run(Script1.groovy:4)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:149)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:239)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:148)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:43)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at com.eviware.soapui.impl.wsdl.loadtest.WsdlLoadTestRunner$InternalTestCaseRunner.run(WsdlLoadTestRunner.java:544)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
When running the "TestCase - Proc" from the ordinary Run TestCase step, the errors do not occur.
3. Moreover, after several executions of the load test, I cannot edit the script code of "TestCase - Proc", the groovy script editor is in read-only mode. I have to exit and restart SoapUI after that. The explanation is shown in the SoapUI exit dialog: The TestCase is still considered running ("Exit SoapUI? Projects with running tests will not be saved.")
All in all, tc.run() is currently unusable from load tests.