diff --git a/src/org/testKitGen/TestDivider.java b/src/org/testKitGen/TestDivider.java index 40b32bbc..8d503d7f 100644 --- a/src/org/testKitGen/TestDivider.java +++ b/src/org/testKitGen/TestDivider.java @@ -73,13 +73,13 @@ private void divideOnTestTime(List> parallelLists, List te if (testDuration < limitFactor) { Map.Entry entry = new AbstractMap.SimpleEntry<>(index, testDuration); machineQueue.offer(entry); - } else { + } else { /* If the test time is greater than the limiting factor, set it as the new limiting factor. */ limitFactor = testDuration; System.out.println("Warning: Test " + testName + " has duration " + formatTime(testDuration) + ", which is greater than the specified test list execution time " + testTime + "m. So this value is used to limit the overall execution time."); } index++; - + } } } @@ -107,19 +107,19 @@ private void divideOnMachineNum(List> parallelLists, List } private String constructURL(String impl, String plat, String group, String level) { - int limit = 10; // limit the number of builds used to calculate the average duration + int limit = 10; // limit the number of builds used to calculate the average duration String URL = (arg.getTRSSURL().isEmpty() ? Constants.TRSS_URL : arg.getTRSSURL()) + "/api/getTestAvgDuration?limit=" + limit + "&jdkVersion=" + arg.getJdkVersion() + "&impl=" + impl + "&platform=" + plat; if (tt.isSingleTest()) { URL += "&testName=" + tt.getTestTargetName(); } else if (tt.isCategory()) { if (!group.equals("")) { - URL += "&group=" + group; + URL += "&group=" + group; } if (!level.equals("")) { - URL += "&level=" + level; + URL += "&level=" + level; } - } + } return URL; } @@ -226,7 +226,7 @@ private Map getDataFromTRSS() { String level = getLevel(); Map map = new HashMap(); String URL = constructURL(impl, plat, group, level); - String command = "curl --silent --max-time 120 " + URL; + String command = "curl --silent --max-time 120 -L " + URL; System.out.println("Attempting to get test duration data from TRSS."); System.out.println(command); Process process; @@ -241,6 +241,7 @@ private Map getDataFromTRSS() { parseDuration(responseReader, map); } catch (IOException | ParseException e) { System.out.println("Warning: cannot parse data from TRSS."); + e.printStackTrace(); } return map; } @@ -294,7 +295,7 @@ private Queue> createDurationQueue() { } } - System.out.println("\nTEST DURATION"); + System.out.println("\nTEST DURATION"); System.out.println("===================================================================================="); System.out.println("Total number of tests searched: " + numOfTests); int foundNum = numOfTests - testsNotFound.size() - testsInvalid.size();