Skip to content

Commit eab82c6

Browse files
author
duke
committed
Backport a840dc22c575b5d2b5b6017a536a6541fc1f0a44
1 parent 796f2b4 commit eab82c6

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/hotspot/jtreg/runtime/ErrorHandling/PrintVMInfoAtExitTest.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,18 @@
2727
* @test
2828
* @summary Test PrintVMInfoAtExit
2929
* @library /test/lib
30+
* @build jdk.test.whitebox.WhiteBox
31+
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
3032
* @modules java.base/jdk.internal.misc
3133
* @requires vm.flagless
3234
* @requires vm.bits == "64"
33-
* @run driver PrintVMInfoAtExitTest
35+
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI PrintVMInfoAtExitTest
3436
*/
3537

3638
import jdk.test.lib.process.OutputAnalyzer;
3739
import jdk.test.lib.process.ProcessTools;
40+
import jdk.test.whitebox.WhiteBox;
41+
3842

3943
public class PrintVMInfoAtExitTest {
4044

@@ -53,7 +57,14 @@ public static void main(String[] args) throws Exception {
5357
output_detail.shouldContain("-- S U M M A R Y --");
5458
output_detail.shouldContain("Command Line: -Xmx64M -Xms64M -XX:-CreateCoredumpOnCrash -XX:+UnlockDiagnosticVMOptions -XX:+PrintVMInfoAtExit -XX:NativeMemoryTracking=summary -XX:CompressedClassSpaceSize=256m");
5559
output_detail.shouldContain("Native Memory Tracking:");
56-
output_detail.shouldContain("Java Heap (reserved=65536KB, committed=65536KB)");
60+
WhiteBox wb = WhiteBox.getWhiteBox();
61+
if (wb.isAsanEnabled()) {
62+
// the reserved value can be influenced by asan
63+
output_detail.shouldContain("Java Heap (reserved=");
64+
output_detail.shouldContain(", committed=65536KB)");
65+
} else {
66+
output_detail.shouldContain("Java Heap (reserved=65536KB, committed=65536KB)");
67+
}
5768
}
5869
}
5970

0 commit comments

Comments
 (0)