Forum Discussion

grexe's avatar
grexe
Occasional Contributor
15 years ago

Synchronization issue with shared DataSinks

We are experiencing reproducible failures when using a shared [tt:2hywipcn]DataSink[/tt:2hywipcn] for our load tests.

The [tt:2hywipcn]DataSink[/tt:2hywipcn] writes various properties generated in previous steps (by Groovy scripts) and a [tt:2hywipcn]DataSource[/tt:2hywipcn] property to a CSV file (sothat we can identify what test data has been generated).
In most of the cases (up to 10 threads and 20 seconds it seems to work, but with more threads or longer running time we always get a failure) at the end of our test (we cannot say for sure because logging is disabled during load tests), the DataSink step fails with no further information on why.

The [tt:2hywipcn]DataSink[/tt:2hywipcn] is shared among working Threads, because we want one big CSV with all test ID's we generate, so we suspect it's a synchronization issue and writing to the file or closing the file is not well synchronized among the soapUI worker threads.

The file seems to be OK, so it is probably only a problem when closing the file - e.g., one Thread tries to close it but it is already closed so we get an IOException.

This bug in the [tt:2hywipcn]DataSink[/tt:2hywipcn] makes it hard for us to automatically detect whether the test has passed or not, we need a fix for this issue.
  • grexe's avatar
    grexe
    Occasional Contributor
    Update: Here's the corresponding error report:
    time,type,step,message
    2011-02-08 12:32:12,Message,,"LoadTest started at Tue Feb 08 12:32:12 UTC 2011"
    2011-02-08 12:33:14,Message,,"LoadTest ended at Tue Feb 08 12:33:14 UTC 2011"
    2011-02-08 12:33:15,Step Status,create-vehicle-passage-video.csv,"TestStep [create-vehicle-passage-video.csv] result status is FAILED; [Failed] [threadIndex=2]"
    2011-02-08 12:33:15,Step Status,create-vehicle-passage-video.csv,"TestStep [create-vehicle-passage-video.csv] result status is FAILED; [Failed] [threadIndex=0]"

    PS: @admin: please move this to soapUI Pro Bugs, I posted in the wrong forum...
  • grexe's avatar
    grexe
    Occasional Contributor
    I've found a stack trace in the soapui-error.log generated by the test runner, seems it is really a synchronization issue with the [tt:29hd3xvx]DataSink[/tt:29hd3xvx]:
    at com.eviware.soapui.tools.SoapUITestCaseRunner.throwFailureException(SoapUITestCaseRunner.java:503)
    at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:408)
    at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:149)
    at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:84)
    at com.eviware.soapui.SoapUIProTestCaseRunner.main(SourceFile:48)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
    at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
    at org.apache.tools.ant.taskdefs.Java.run(Java.java:771)
    at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
    at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
    at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.Main.runBuild(Main.java:809)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
    2011-02-09 09:06:06,554 ERROR [errorlog] java.util.concurrent.ExecutionException: java.lang.NullPointerException
    java.util.concurrent.ExecutionException: java.lang.NullPointerException
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
    at java.util.concurrent.FutureTask.get(FutureTask.java:83)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.waitUntilFinished(AbstractTestRunner.java:221)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner.runTestCase(WsdlTestSuiteRunner.java:173)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner.runSequential(WsdlTestSuiteRunner.java:143)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner.internalRun(WsdlTestSuiteRunner.java:98)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestSuiteRunner.internalRun(WsdlTestSuiteRunner.java:42)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.NullPointerException
    at com.eviware.soapui.impl.wsdl.teststeps.datasink.FileDataSink.finish(SourceFile:258)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlDataSinkTestStep.finish(SourceFile:231)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalFinally(WsdlTestCaseRunner.java:171)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalFinally(WsdlTestCaseRunner.java:39)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:163)
    ... 6 more
  • Hi!

    ok, thanks. This is easily fixed but it shouldn't happen in the first place, we'll dig in and get back to you.

    regards!

    /Ole
    eviware.com
  • Hi again,

    I've made some fixes in regard to this coming in the nightly build, please give it a go and let us know if it helps.

    regards!

    /Ole
    eviware.com
  • grexe's avatar
    grexe
    Occasional Contributor
    Thanks for your support, we'll test this as soon as possible, unfort. the web service endpoint is down ATM...