EvoSuite / evosuite

EvoSuite - automated generation of JUnit test suites for Java classes
http://www.evosuite.org
GNU Lesser General Public License v3.0
841 stars 342 forks source link

java.rmi.SocketException thrown: Too many open files #36

Open Akrabor opened 8 years ago

Akrabor commented 8 years ago

Dear all,

I am running evosuite on a server to generate tests for a bigger project (~3000 classes) and get the mentioned exception for a good number of them. The stacktrace is posted below. Do you know how to prevent this?

Evosuite is executed via an ant script. Task is posted below (classpath externally defined in evosuite.properties).

My setup is: Ubuntu 14.04 LTS Java 8 Ant 1.9 Evosuite 1.0.3 release

Cheers, Henrik

Ant Task:

<java jar="${tools.dir}/lib/${evosuite.jar}" fork="true">
    <arg value="-target"/>
    <arg value="${build.main.dir}" />
    <arg value="-mem"/>
    <arg value="4000" />
    <arg value="-Dsearch_budget" />
    <arg value="300" />
    <arg value="-Djunit_check" />
    <arg value="false" />
    <arg value="-Duse_separate_classloader"/>
    <arg value="false"/>
    <arg value="-Dreport_dir"/>
    <arg value="${basedir}/evosuite-report"/>
    <arg value="-Dcriterion"/>
    <arg value="BRANCH"/>
    <arg value="-Doutput_variables"/>
    <arg value="TARGET_CLASS,criterion,BranchCoverage,Coverage,Covered_Goals,Total_Goals"/>
</java>

Stacktrace:

[java] [MASTER] 14:27:48.903 [logback-2] ERROR ClientNodeImpl - Cannot inform master of change of state
 [java] java.rmi.ConnectIOException: Exception creating connection to: 127.0.0.1; nested exception is:
 [java]     java.net.SocketException: Too many open files
 [java]     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:631) ~[na:1.8.0_77]
 [java]     at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216) ~[na:1.8.0_77]
 [java]     at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202) ~[na:1.8.0_77]
 [java]     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:130) ~[na:1.8.0_77]
 [java]     at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227) ~[na:1.8.0_77]
 [java]     at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179) ~[na:1.8.0_77]
 [java]     at com.sun.proxy.$Proxy9.evosuite_informChangeOfStateInClient(Unknown Source) ~[na:na]
 [java]     at org.evosuite.rmi.service.ClientNodeImpl.changeState(ClientNodeImpl.java:220) ~[evosuite-1.0.3.jar:1.0.3]
 [java]     at org.evosuite.ProgressMonitor.updateStatus(ProgressMonitor.java:72) [evosuite-1.0.3.jar:1.0.3]
 [java]     at org.evosuite.ProgressMonitor.iteration(ProgressMonitor.java:105) [evosuite-1.0.3.jar:1.0.3]
 [java]     at org.evosuite.ga.metaheuristics.GeneticAlgorithm.notifyIteration(GeneticAlgorithm.java:751) [evosuite-1.0.3.jar:1.0.3]
 [java]     at org.evosuite.ga.metaheuristics.MonotonicGA.generateSolution(MonotonicGA.java:307) [evosuite-1.0.3.jar:1.0.3]
 [java]     at org.evosuite.strategy.WholeTestSuiteStrategy.generateTests(WholeTestSuiteStrategy.java:113) [evosuite-1.0.3.jar:1.0.3]
 [java]     at org.evosuite.TestSuiteGenerator.generateTests(TestSuiteGenerator.java:453) [evosuite-1.0.3.jar:1.0.3]
 [java]     at org.evosuite.TestSuiteGenerator.generateTestSuite(TestSuiteGenerator.java:146) [evosuite-1.0.3.jar:1.0.3]
 [java]     at org.evosuite.rmi.service.ClientNodeImpl$1.run(ClientNodeImpl.java:145) [evosuite-1.0.3.jar:1.0.3]
 [java]     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_77]
 [java]     at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_77]
 [java]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_77]
 [java]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_77]
 [java]     at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77]
 [java] Caused by: java.net.SocketException: Too many open files
 [java]     at java.net.Socket.createImpl(Socket.java:460) ~[na:1.8.0_77]
 [java]     at java.net.Socket.<init>(Socket.java:431) ~[na:1.8.0_77]
 [java]     at java.net.Socket.<init>(Socket.java:211) ~[na:1.8.0_77]
 [java]     at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40) ~[na:1.8.0_77]
 [java]     at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148) ~[na:1.8.0_77]
 [java]     at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613) ~[na:1.8.0_77]
 [java]     ... 20 common frames omitted
gofraser commented 6 years ago

Is there some minimal example that can be used to reproduce this behaviour?