Skip to content

Commit

Permalink
Issue checkstyle#11446: Updated CheckerTest tests to stop verify usage
Browse files Browse the repository at this point in the history
  • Loading branch information
MANISH-K-07 authored and piyush kumar sadangi committed Feb 11, 2024
1 parent 0076988 commit ac7e7de
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .ci/checker-framework.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -112,27 +112,34 @@ private static int checkCheckerFrameworkReport(final String profile) {
*/
private static List<List<String>> getCheckerFrameworkErrors(final String profile) {
final List<String> checkerFrameworkLines = new ArrayList<>()
final List<List<String>> checkerFrameworkErrors = new ArrayList<>()
final String command = "mvn -e --no-transfer-progress clean compile" +
" -P${profile},no-validations"
final ProcessBuilder processBuilder = new ProcessBuilder(getOsSpecificCmd(command).split(' '))
processBuilder.redirectErrorStream(true)
final Process process = processBuilder.start()

BufferedReader reader = null
try {
Pattern detailedOomErrorPattern = Pattern.compile
(".*OutOfMemoryError.*max memory = \\d+.*total memory = \\d+.*free memory = \\d+.*",
Pattern.CASE_INSENSITIVE)
reader = new BufferedReader(new InputStreamReader(process.inputStream))
String lineFromReader = reader.readLine()
while (lineFromReader != null) {
println(lineFromReader)
checkerFrameworkLines.add(lineFromReader)
if (detailedOomErrorPattern.matcher(lineFromReader).matches()) {
List<String> oomError = new ArrayList<>()
oomError.add("ERROR: " + lineFromReader)
checkerFrameworkErrors.add(oomError)
}
lineFromReader = reader.readLine()
}
process.waitFor()
} finally {
reader.close()
}

final List<List<String>> checkerFrameworkErrors = new ArrayList<>()
for (int index = 0; index < checkerFrameworkLines.size(); index++) {
final String line = checkerFrameworkLines.get(index)
if (line.startsWith('[WARNING]')) {
Expand Down

0 comments on commit ac7e7de

Please sign in to comment.