8378112: Test runtime/ErrorHandling/MachCodeFramesInErrorFile.java fails with RuntimeException: 1 < 2

Reviewed-by: phubner, matsaave
This commit is contained in:
Coleen Phillimore 2026-02-19 22:17:41 +00:00
parent 2a71f89bc8
commit ff1c42f111

View File

@ -169,6 +169,10 @@ public class MachCodeFramesInErrorFile {
Matcher matcher = Pattern.compile("\\[MachCode\\]\\s*\\[Verified Entry Point\\]\\s* # \\{method\\} \\{[^}]*\\} '([^']+)' '([^']+)' in '([^']+)'", Pattern.DOTALL).matcher(hsErr);
List<String> machCodeHeaders = matcher.results().map(mr -> String.format("'%s' '%s' in '%s'", mr.group(1), mr.group(2), mr.group(3))).collect(Collectors.toList());
int minExpectedMachCodeSections = Math.max(1, compiledJavaFrames);
if ((hsErr.contains("stop reattempt (retry printing native stack (no source info))") || hsErr.contains("reason: Step time limit reached"))) {
// In this case, the vm only prints the crashing frame.
minExpectedMachCodeSections = 1;
}
if (machCodeHeaders.size() < minExpectedMachCodeSections) {
Asserts.fail(machCodeHeaders.size() + " < " + minExpectedMachCodeSections);
}