8373876: StackWalkNativeToJava print more output in case of failures

Reviewed-by: dholmes, mdoerr
This commit is contained in:
Matthias Baesken 2025-12-22 07:57:31 +00:00
parent 9435d5b89c
commit 3579c752bc

View File

@ -70,7 +70,11 @@ public class StackWalkNativeToJava {
output.shouldNotContain("java.lang.RuntimeException: Reached statement after obj.wait()");
output.shouldNotContain("[error occurred during error reporting (printing native stack");
String[] res = output.getOutput().split("StackWalkNativeToJava\\$TestNativeToJavaNative\\.callNativeMethod\\(\\)V");
assertTrue(res.length - 1 == 2, res.length - 1);
if (res.length != 3) {
output.reportDiagnosticSummary();
}
assertTrue(res.length == 3, res.length);
output.shouldNotHaveExitValue(0);
}
@ -104,7 +108,11 @@ public class StackWalkNativeToJava {
output.shouldNotContain("java.lang.RuntimeException: Reached statement after synchronized");
output.shouldNotContain("[error occurred during error reporting (printing native stack");
String[] res = output.getOutput().split("StackWalkNativeToJava\\$TestNativeToJava\\.callVMMethod\\(\\)V");
assertTrue(res.length - 1 == 2, res.length - 1);
if (res.length != 3) {
output.reportDiagnosticSummary();
}
assertTrue(res.length == 3, res.length);
output.shouldNotHaveExitValue(0);
}
@ -131,4 +139,4 @@ public class StackWalkNativeToJava {
throw new RuntimeException("Count error: count was " + count);
}
}
}
}