diff --git a/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java b/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java index ba36d5810d8..7608c5f5619 100644 --- a/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java +++ b/test/hotspot/jtreg/runtime/ErrorHandling/MachCodeFramesInErrorFile.java @@ -169,6 +169,10 @@ public class MachCodeFramesInErrorFile { Matcher matcher = Pattern.compile("\\[MachCode\\]\\s*\\[Verified Entry Point\\]\\s* # \\{method\\} \\{[^}]*\\} '([^']+)' '([^']+)' in '([^']+)'", Pattern.DOTALL).matcher(hsErr); List 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); }