Skip to content

Commit

Permalink
Add follow redirect in querying
Browse files Browse the repository at this point in the history
- Added `-L` to support http TRSS URL.

resolves: #555

Signed-off-by: Anna Babu Palathingal <anna.bp@ibm.com>
  • Loading branch information
annaibm committed May 28, 2024
1 parent 3ed8f8b commit 84fd7f0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/org/testKitGen/TestDivider.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ private void divideOnTestTime(List<List<String>> parallelLists, List<Integer> te
if (testDuration < limitFactor) {
Map.Entry<Integer,Integer> 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++;

}
}
}
Expand Down Expand Up @@ -107,19 +107,19 @@ private void divideOnMachineNum(List<List<String>> parallelLists, List<Integer>
}

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;
}

Expand Down Expand Up @@ -226,7 +226,7 @@ private Map<String, Integer> getDataFromTRSS() {
String level = getLevel();
Map<String, Integer> map = new HashMap<String, Integer>();
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;
Expand Down Expand Up @@ -294,7 +294,7 @@ private Queue<Map.Entry<String, Integer>> 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();
Expand Down

0 comments on commit 84fd7f0

Please sign in to comment.