Skip to content

Commit

Permalink
8295191: IR framework timeout options expect ms instead of s
Browse files Browse the repository at this point in the history
Reviewed-by: chagedorn, kvn, thartmann
  • Loading branch information
enothum authored and TobiHartmann committed Jun 29, 2023
1 parent af319d9 commit b2eae16
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
*/
abstract class AbstractTest {
protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
protected static final int TEST_COMPILATION_TIMEOUT = Integer.parseInt(System.getProperty("TestCompilationTimeout", "10000"));
protected static final int WAIT_FOR_COMPILATION_TIMEOUT = Integer.parseInt(System.getProperty("WaitForCompilationTimeout", "10000"));
protected static final int TEST_COMPILATION_TIMEOUT_MS = Integer.parseInt(System.getProperty("TestCompilationTimeout", "10")) * 1000;
protected static final int WAIT_FOR_COMPILATION_TIMEOUT_MS = Integer.parseInt(System.getProperty("WaitForCompilationTimeout", "10")) * 1000;
protected static final boolean VERIFY_OOPS = (Boolean)WHITE_BOX.getVMFlag("VerifyOops");

protected final int warmupIterations;
Expand Down Expand Up @@ -149,10 +149,10 @@ protected void compileMethod(DeclaredTest test) {
break;
}
elapsed = System.currentTimeMillis() - started;
} while (elapsed < TEST_COMPILATION_TIMEOUT);
TestRun.check(elapsed < TEST_COMPILATION_TIMEOUT,
} while (elapsed < TEST_COMPILATION_TIMEOUT_MS);
TestRun.check(elapsed < TEST_COMPILATION_TIMEOUT_MS,
"Could not compile " + testMethod + " at level " + test.getCompLevel() + " after "
+ TEST_COMPILATION_TIMEOUT/1000 + "s. Last compilation level: " + lastCompilationLevel);
+ TEST_COMPILATION_TIMEOUT_MS/1000 + "s. Last compilation level: " + lastCompilationLevel);
checkCompilationLevel(test);
}

Expand Down Expand Up @@ -194,9 +194,9 @@ final protected void waitForCompilation(DeclaredTest test) {
// Don't wait for compilation if -Xcomp is enabled or if we are randomly excluding methods from compilation.
return;
}
} while (elapsed < WAIT_FOR_COMPILATION_TIMEOUT);
} while (elapsed < WAIT_FOR_COMPILATION_TIMEOUT_MS);
throw new TestRunException(testMethod + " not compiled after waiting for "
+ WAIT_FOR_COMPILATION_TIMEOUT/1000 + " s");
+ WAIT_FOR_COMPILATION_TIMEOUT_MS/1000 + " s");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ private void compileMultipleTests() {
executor.shutdown();
int timeout;
if (anyCompileMethod && anyWaitForCompilation) {
timeout = Math.max(WAIT_FOR_COMPILATION_TIMEOUT, TEST_COMPILATION_TIMEOUT) + 5000;
timeout = Math.max(WAIT_FOR_COMPILATION_TIMEOUT_MS, TEST_COMPILATION_TIMEOUT_MS) + 5000;
} else if (anyWaitForCompilation) {
timeout = WAIT_FOR_COMPILATION_TIMEOUT + 5000;
timeout = WAIT_FOR_COMPILATION_TIMEOUT_MS + 5000;
} else {
timeout = TEST_COMPILATION_TIMEOUT + 5000;
timeout = TEST_COMPILATION_TIMEOUT_MS + 5000;
}
try {
executor.awaitTermination(timeout, TimeUnit.MILLISECONDS);
Expand Down

1 comment on commit b2eae16

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.