Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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();
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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment