Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
16 years ago

groovy script load testing issues

I have a groovy teststep in my load test test case which has the following line which seems to be causing a problem when I run a multi-threaded test.

def props3 = testRunner.testCase.testSuite
props3.setPropertyValue(serviceId, missingFile.toString())

It seems like there is some problem when multiple threads are trying to write to the same location?

I get the following error.
Fri Feb 20 18:13:20 CST 2009:ERROR:java.lang.ArrayIndexOutOfBoundsException: 162
  java.lang.ArrayIndexOutOfBoundsException: 162
  at com.eviware.soapui.impl.wsdl.support.XmlBeansPropertiesTestPropertyHolder.getPropertyNames(XmlBeansPropertiesTestPropertyHolder.java:135)
  at com.eviware.soapui.impl.wsdl.AbstractTestPropertyHolderWsdlModelItem.getPropertyNames(AbstractTestPropertyHolderWsdlModelItem.java:104)
  at com.eviware.soapui.impl.wsdl.panels.teststeps.support.PropertyHolderTable$PropertiesModel.fireTableDataChanged(PropertyHolderTable.java:259)
  at com.eviware.soapui.impl.wsdl.panels.teststeps.support.PropertyHolderTable$InternalTestPropertyListener.propertyValueChanged(PropertyHolderTable.java:227)
  at com.eviware.soapui.impl.wsdl.support.XmlBeansPropertiesTestPropertyHolder.firePropertyValueChanged(XmlBeansPropertiesTestPropertyHolder.java:110)
  at com.eviware.soapui.impl.wsdl.support.XmlBeansPropertiesTestPropertyHolder.access$300(XmlBeansPropertiesTestPropertyHolder.java:34)
  at com.eviware.soapui.impl.wsdl.support.XmlBeansPropertiesTestPropertyHolder$PropertiesStepProperty.setValue(XmlBeansPropertiesTestPropertyHolder.java:261)
  at com.eviware.soapui.impl.wsdl.support.XmlBeansPropertiesTestPropertyHolder.setPropertyValue(XmlBeansPropertiesTestPropertyHolder.java:174)
  at com.eviware.soapui.impl.wsdl.AbstractTestPropertyHolderWsdlModelItem.setPropertyValue(AbstractTestPropertyHolderWsdlModelItem.java:124)
  at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.lang.reflect.Method.invoke(Unknown Source)
  at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
  at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230)
  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:912)
  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:756)
  at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:766)
  at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:754)
  at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:170)
  at Script2.run(Script2.groovy:32)
  at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:59)
  at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:52)
  at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148)
  at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runTestStep(WsdlTestCaseRunner.java:273)
  at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.run(WsdlTestCaseRunner.java:182)
  at com.eviware.soapui.impl.wsdl.loadtest.WsdlLoadTestRunner$TestCaseRunner.run(WsdlLoadTestRunner.java:461)
  at java.lang.Thread.run(Unknown Source)

What can I do to solve this problem. I am trying to write some results from each thread to a common place.

Thanks

Ali

2 Replies

  • alibaba82's avatar
    alibaba82
    Super Contributor
    This is an urgent issue. can someone reply please.

    Thanks
    Ali
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Ali,

    Sorry for the delay.. yes, that could be the case. Could you try surrounding the statement with a synchronized block that synchronizes on the LoadTest run context?

    ie

    synchronized( context.LoadTestContext)
    {
      def props3 = testRunner.testCase.testSuite
      props3.setPropertyValue(serviceId, missingFile.toString())
    }

    ?

    regards,

    /Ole
    eviware.com