Skip to content

Commit

Permalink
Add timeoutFactor option to JavatestUtil
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Leonard <[email protected]>
  • Loading branch information
andrew-m-leonard committed Jan 29, 2025
1 parent f916545 commit 7f6ecc0
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions jck/jtrunner/JavatestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class JavatestUtil {
private static String interactive;
private static String extraJvmOptions = "";
private static String concurrencyString;
private static String timeoutFactorString;
private static String jckVersion;
private static String config;
private static String configAltPath;
Expand Down Expand Up @@ -114,6 +115,7 @@ public class JavatestUtil {
private static final String INTERACTIVE = "interactive";
private static final String CONFIG = "config";
private static final String CONCURRENCY = "concurrency";
private static final String TIMEOUT_FACTOR = "timeoutFactor";
private static final String CONFIG_ALT_PATH = "configAltPath";
private static final String TASK = "task";
private static final String TASK_CMD_FILE_GENERATION = "cmdfilegen";
Expand All @@ -138,6 +140,7 @@ public static void main(String args[]) throws Exception {
essentialParameters.add(INTERACTIVE);
essentialParameters.add(CONFIG);
essentialParameters.add(CONCURRENCY);
essentialParameters.add(TIMEOUT_FACTOR);
essentialParameters.add(CONFIG_ALT_PATH);
essentialParameters.add(TASK);
essentialParameters.add(AGENT_HOST);
Expand Down Expand Up @@ -209,6 +212,7 @@ public static void main(String args[]) throws Exception {
withAgent = testArgs.get(WITH_AGENT) == null ? "off" : testArgs.get(WITH_AGENT);
interactive = testArgs.get(INTERACTIVE) == null ? "no" : testArgs.get(INTERACTIVE);
concurrencyString = testArgs.get("concurrency") == null ? "NULL" : testArgs.get("concurrency");
timeoutFactorString = testArgs.get(TIMEOUT_FACTOR) == null ? "NULL" : testArgs.get(TIMEOUT_FACTOR);
config = testArgs.get(CONFIG) == null ? "NULL" : testArgs.get(CONFIG);
configAltPath = testArgs.get(CONFIG_ALT_PATH) == null ? "NULL" : testArgs.get(CONFIG_ALT_PATH);
agentHost = testArgs.get(AGENT_HOST) == null ? "localhost" : testArgs.get(AGENT_HOST).trim();
Expand Down Expand Up @@ -515,7 +519,12 @@ private static boolean generateJTB() throws Exception {
}

fileContent += "concurrency " + concurrencyString + ";\n";
fileContent += "timeoutfactor 4" + ";\n"; // 4 base time limit equal 40 minutes

if (!timeoutFactorString.equals("NULL")) {
fileContent += "timeoutfactor " + timeoutFactorString + ";\n";
} else {
fileContent += "timeoutfactor 4" + ";\n"; // 4 base time limit equal 40 minutes
}
fileContent += keyword + ";\n";

if (spec.contains("win")) {
Expand Down Expand Up @@ -698,7 +707,11 @@ private static boolean generateJTB() throws Exception {
}

fileContent += "concurrency " + concurrencyString + ";\n";
fileContent += "timeoutfactor 100" + ";\n"; // lang.CLSS,CONV,STMT,INFR requires more than 1h to complete. lang.Annot,EXPR,LMBD require more than 2h to complete tests
if (!timeoutFactorString.equals("NULL")) {
fileContent += "timeoutfactor " + timeoutFactorString + ";\n";
} else {
fileContent += "timeoutfactor 100" + ";\n"; // lang.CLSS,CONV,STMT,INFR requires more than 1h to complete. lang.Annot,EXPR,LMBD require more than 2h to complete tests
}
fileContent += keyword + ";\n";

if (testExecutionType.equals("multijvm")) {
Expand Down Expand Up @@ -819,7 +832,11 @@ private static boolean generateJTB() throws Exception {
}

fileContent += "concurrency " + concurrencyString + ";\n";
fileContent += "timeoutfactor 40" + ";\n"; // All Devtools tests take less than 1h to finish.
if (!timeoutFactorString.equals("NULL")) {
fileContent += "timeoutfactor " + timeoutFactorString + ";\n";
} else {
fileContent += "timeoutfactor 40" + ";\n"; // All Devtools tests take less than 1h to finish.
}

if (spec.contains("win")) {
// On Windows set the testplatform.os to Windows and set systemRoot, but do not
Expand Down

0 comments on commit 7f6ecc0

Please sign in to comment.