From 098c1a61e7aa69db27c7ea0007368825ea86fdf4 Mon Sep 17 00:00:00 2001 From: Rene Schneider Date: Fri, 9 Jun 2017 17:18:00 +0200 Subject: [PATCH] Changed some timeouts to be seconds instead of msecs --- .../de/gebit/integrity/runner/DefaultTestRunner.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/de.gebit.integrity.runner/src/de/gebit/integrity/runner/DefaultTestRunner.java b/de.gebit.integrity.runner/src/de/gebit/integrity/runner/DefaultTestRunner.java index 1d3ae8035..ef1591a55 100644 --- a/de.gebit.integrity.runner/src/de/gebit/integrity/runner/DefaultTestRunner.java +++ b/de.gebit.integrity.runner/src/de/gebit/integrity/runner/DefaultTestRunner.java @@ -435,7 +435,7 @@ protected int getForkPauseWaitInterval() { /** * The default time to wait for a fork to become ready for execution. */ - protected static final int FORK_WAIT_UNTIL_READY_TIMEOUT_DEFAULT = (int) TimeUnit.MINUTES.toMillis(5); + protected static final int FORK_WAIT_UNTIL_READY_TIMEOUT_DEFAULT = (int) TimeUnit.MINUTES.toSeconds(5); /** * Returns the time to wait for a fork to become ready for execution. @@ -461,7 +461,7 @@ protected int getForkWaitUntilReadyTimeoutDefault() { /** * The default time to wait for child processes to be killed. */ - protected static final int CHILD_PROCESS_KILL_TIMEOUT_DEFAULT = 60000; + protected static final int CHILD_PROCESS_KILL_TIMEOUT_DEFAULT = 60; protected int getChildProcessKillTimeout() { return System.getProperty(CHILD_PROCESS_KILL_TIMEOUT_PROPERTY) != null @@ -634,7 +634,7 @@ protected SuiteSummaryResult run(final Suite aRootSuiteCall, VariantDefinition a @Override public void run() { - processTerminator.killAndWait(getChildProcessKillTimeout()); + processTerminator.killAndWait((int) TimeUnit.SECONDS.toMillis(getChildProcessKillTimeout())); } }); @@ -714,7 +714,7 @@ public void run() throws InterruptedException { if (remotingServer != null) { remotingServer.closeAll(true); } - processTerminator.killAndWait(getChildProcessKillTimeout()); + processTerminator.killAndWait((int) TimeUnit.SECONDS.toMillis(getChildProcessKillTimeout())); } } @@ -2819,8 +2819,7 @@ public Boolean run() { // nothing to do here } - if (System.nanoTime() - tempWaitStartTime > TimeUnit.MILLISECONDS - .toNanos(tempWaitTimeout)) { + if (System.nanoTime() - tempWaitStartTime > TimeUnit.SECONDS.toNanos(tempWaitTimeout)) { System.err.println("TIMED OUT WHILE WAITING FOR FORK TO GET READY"); return false; }