EvoSuite / evosuite

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

Error Clients have not finished yet, although a timeout occurred #345

Open albilu opened 3 years ago

albilu commented 3 years ago

Context

Running Evosuite on a bunch of classes

Steps to Reproduce

  1. Unfortunately i can not provide the project as it is proprietary

EvoSuite Arguments

1-"C:\Program Files\Java\jdk1.8.0_181\bin\java" -jar C:\Users\xxx\Downloads\evosuite-1.1.0.jar -Duse_separate_classloader=false -Dreflection_start_percent=0.0 -Dp_reflection_on_private=1.0 -setup build\classes build\public-package-jars*.jar build\cluster\modules\ext*.jar

2-"C:\Program Files\Java\jdk1.8.0_181\bin\java" -jar C:\Users\xxx\Downloads\evosuite-1.1.0.jar -target build\classes

Current Result

The test generation stuck on a file and it is impossible to continue

[MASTER] 15:27:04.790 [logback-2] ERROR ConcreteClassAnalyzer - Removing class from inheritance tree

Expected result

Test generation Completed

Additional info

Issue is the same when increasing the timeout by using -Dextra_timeout=180 Issue is the same as #96

VoglSebastian commented 3 years ago

Hi,

this error typically occurs, when the thread that generates the tests is in garbage collection, when it is supposed to stop. Often this can be prevented by setting the max heap space differently. Note that both to much and not enough heap is possible. I typically use heap sizes ~2 - 4g when running EvoSuite.

Garbage collection is managed by the JVM. Therefore, we can hardly do anything to prevent this from happening (,if it is the cause)

How to set the heap size of the JVM: https://docs.oracle.com/cd/E19563-01/819-4438/gavou/index.html

albilu commented 3 years ago

Hi, so tried by modifying the JVM heap like this: "C:\Program Files\Java\jdk1.8.0_181\bin\java" -Xms2048m -Xmx4096m -jar C:\Users\xxx\Downloads\evosuite-1.1.0.jar -target build\classes

but still i got the issue.

gofraser commented 3 years ago

Not sure if this is really a memory issue, but the command line C:\Program Files\Java\jdk1.8.0_181\bin\java" -Xms2048m -Xmx4096m -jar C:\Users\xxx\Downloads\evosuite-1.1.0.jar -target build\classes only sets the memory for the master process. EvoSuite will spawn a client process in which it runs test generation, and that will use the system default. You can explicitly change that using the -mem option, e.g.:

java -jar evosuite-1.1.0.jar -mem 4096 -target build/classes

If this doesn't help, is the AtomicLogHistory class available somewhere to reproduce this?