aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hui Shi <kalinshi@tencent.com> 2021-04-17 12:50:28 +0800
committerGravatar Hui Shi <kalinshi@tencent.com> 2021-04-17 12:50:28 +0800
commitc1ffe6ed41cec9cd35eee79503c97afa97655d57 (patch)
treed68fe06068fa666b44bd0aa6186ad81ffcf7d820
parenta6245748359b07195636ffa747b75f890c68b642 (diff)
downloadjdk-pr/3432.tar.gz
jdk-pr/3432.zip
Fix test fail on aarch64 when VM page is larger than 4Kpr/3432
-rw-r--r--test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java b/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java
index 571ebfeccc4..c6c592dbd39 100644
--- a/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java
+++ b/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java
@@ -26,6 +26,7 @@ package jdk.jfr.startupargs;
import jdk.test.lib.Asserts;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
+import sun.hotspot.WhiteBox;
/**
* @test
@@ -37,7 +38,9 @@ import jdk.test.lib.process.ProcessTools;
* java.management
* jdk.jfr
*
- * @run main jdk.jfr.startupargs.TestBadOptionValues
+ * @build sun.hotspot.WhiteBox
+ * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI jdk.jfr.startupargs.TestBadOptionValues
*/
public class TestBadOptionValues {
@@ -136,8 +139,13 @@ public class TestBadOptionValues {
"memorysize=1m,threadbuffersize=2m");
// computed globalbuffersize smaller than threadbuffersize
- test(FLIGHT_RECORDER_OPTIONS, "Decrease globalbuffersize or increase memorysize or adjust global/threadbuffersize",
- "memorysize=1m,numglobalbuffers=256");
+ // test is on when vm page isn't larger than 4K, avoiding both buffer sizes align to vm page size
+ WhiteBox wb = WhiteBox.getWhiteBox();
+ long smallPageSize = wb.getVMPageSize();
+ if (smallPageSize <= 4096) {
+ test(FLIGHT_RECORDER_OPTIONS, "Decrease globalbuffersize or increase memorysize or adjust global/threadbuffersize",
+ "memorysize=1m,numglobalbuffers=256");
+ }
test(FLIGHT_RECORDER_OPTIONS, "Parsing error memory size value: invalid value",
"threadbuffersize=a",