Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.evosuite.testcase.execution.reset.ClassReInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.vorpal.research.kex.trace.symbolic.SymbolicTraceBuilder;

/**
* <p>
Expand Down Expand Up @@ -398,6 +399,7 @@ private ExecutionResult execute(TestCase tc, Scope scope, int timeout) {
}
logger.info("TimeoutException, need to stop runner", e1);
ExecutionTracer.setKillSwitch(true);
SymbolicTraceBuilder.setKillSwitch(true);
try {
handler.getLastTask().get(Properties.SHUTDOWN_TIMEOUT, TimeUnit.MILLISECONDS);
} catch (InterruptedException e2) {
Expand All @@ -419,6 +421,7 @@ private ExecutionResult execute(TestCase tc, Scope scope, int timeout) {
// until we're outside the static constructor
LoopCounter.getInstance().setActive(false);
ExecutionTracer.setKillSwitch(false);
SymbolicTraceBuilder.setKillSwitch(false);
logger.info("Run still not finished, but awaiting for static initializer to finish.");

try {
Expand All @@ -430,6 +433,7 @@ private ExecutionResult execute(TestCase tc, Scope scope, int timeout) {
}
LoopCounter.getInstance().setActive(loopCounter);
ExecutionTracer.setKillSwitch(true);
SymbolicTraceBuilder.setKillSwitch(true);

if (!callable.isRunFinished()) {
handler.getLastTask().cancel(true);
Expand Down Expand Up @@ -483,6 +487,7 @@ private ExecutionResult execute(TestCase tc, Scope scope, int timeout) {
result.setTrace(ExecutionTracer.getExecutionTracer().getTrace());
ExecutionTracer.getExecutionTracer().clear();
ExecutionTracer.setKillSwitch(false);
SymbolicTraceBuilder.setKillSwitch(false);
ExecutionTracer.enable();
System.setOut(systemOut);
System.setErr(systemErr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.slf4j.LoggerFactory;

import org.evosuite.dse.VMError;
import org.vorpal.research.kex.trace.symbolic.SymbolicTraceException;

/**
* <p>
Expand All @@ -54,6 +55,7 @@
public class TestRunnable implements InterfaceTestRunnable {

private static final Logger logger = LoggerFactory.getLogger(TestRunnable.class);
private static final Logger statLogger = LoggerFactory.getLogger("StatLogger");

private static ByteArrayOutputStream byteStream = new ByteArrayOutputStream();

Expand Down Expand Up @@ -197,7 +199,7 @@ public ExecutionResult call() {
if(Properties.REPLACE_CALLS){
ShutdownHookHandler.getInstance().initHandler();
}

executeStatements(result, out, num);
} catch (ThreadDeath e) {// can't stop these guys
logger.info("Found error in " + test.toCode(), e);
Expand Down Expand Up @@ -308,7 +310,11 @@ private void executeStatements(ExecutionResult result, PrintStream out,
/*
* This is implemented in this way due to ExecutionResult.hasTimeout()
*/
if (exceptionThrown instanceof TestCaseExecutor.TimeoutExceeded) {
if (exceptionThrown instanceof TestCaseExecutor.TimeoutExceeded ||
(exceptionThrown instanceof SymbolicTraceException &&
exceptionThrown.getCause() instanceof org.vorpal.research.kex.util.TimeoutException)) {
if (!(exceptionThrown instanceof TestCaseExecutor.TimeoutExceeded))
statLogger.debug("Kex timeout triggered");
logger.debug("Test timed out!");
exceptionsThrown.put(test.size(), exceptionThrown);
result.setThrownExceptions(exceptionsThrown);
Expand Down
1 change: 1 addition & 0 deletions client/src/main/kotlin/org/evosuite/kex/KexService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.vorpal.research.kex.launcher.LauncherException
import org.vorpal.research.kex.launcher.prepareInstrumentedClasspath
import org.vorpal.research.kex.random.easyrandom.EasyRandomDriver
import org.vorpal.research.kex.reanimator.codegen.javagen.ReflectionUtilsPrinter
import org.vorpal.research.kex.trace.symbolic.SymbolicTraceException
import org.vorpal.research.kex.util.*
import org.vorpal.research.kfg.ClassManager
import org.vorpal.research.kfg.KfgConfig
Expand Down
Loading