Commit b49e842e authored by René Schöne's avatar René Schöne
Browse files

Wait for the forked process at mosst double amount of the timeout, then kill it.

parent fd919675
......@@ -16,6 +16,7 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
......@@ -88,7 +89,18 @@ public class FullBenchmarkMain {
pb.redirectError(ProcessBuilder.Redirect.INHERIT);
pb.directory(currentDir);
Process p = pb.start();
p.waitFor();
boolean finishedInTime = p.waitFor(settings.basic.timeoutValue * 2,
TimeUnit.valueOf(settings.basic.timeoutUnit));
if(!finishedInTime) {
p.destroy();
p.destroyForcibly();
// wait for the process to actually end
p.waitFor();
// skip remaining repetitions, as this timeout is considered as an error
if (settings.skipOnError) {
continue nextSolver;
}
}
} catch (IOException | InterruptedException e) {
e.printStackTrace();
if (settings.skipOnError) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment