From b2eae16c4504fb13bd06c999ef97f2faf0ad4932 Mon Sep 17 00:00:00 2001 From: Eric Nothum Date: Thu, 29 Jun 2023 06:59:12 +0000 Subject: [PATCH] 8295191: IR framework timeout options expect ms instead of s Reviewed-by: chagedorn, kvn, thartmann --- .../lib/ir_framework/test/AbstractTest.java | 14 +++++++------- .../lib/ir_framework/test/CustomRunTest.java | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/AbstractTest.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/AbstractTest.java index 68d8d0f5aaf..6628765863d 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/test/AbstractTest.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/AbstractTest.java @@ -37,8 +37,8 @@ import java.lang.reflect.Modifier; */ 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; @@ -149,10 +149,10 @@ abstract class AbstractTest { 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); } @@ -194,9 +194,9 @@ abstract class AbstractTest { // 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"); } /** diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/CustomRunTest.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/CustomRunTest.java index 66240b9f2ea..bd88d44ce44 100644 --- a/test/hotspot/jtreg/compiler/lib/ir_framework/test/CustomRunTest.java +++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/CustomRunTest.java @@ -133,11 +133,11 @@ class CustomRunTest extends AbstractTest { 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);