Skip to content

Commit 9bf3dee

Browse files
author
Mikhailo Seledtsov
committed
8314831: NMT tests ignore vm flags
Reviewed-by: lmesnik, stuefe, gziemski
1 parent b74805d commit 9bf3dee

11 files changed

+29
-18
lines changed

test/hotspot/jtreg/runtime/NMT/CommandLineDetail.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@ public class CommandLineDetail {
3737

3838
public static void main(String args[]) throws Exception {
3939

40-
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
40+
ProcessBuilder pb = ProcessTools.createTestJvm(
4141
"-XX:NativeMemoryTracking=detail",
4242
"-version");
4343
OutputAnalyzer output = new OutputAnalyzer(pb.start());

test/hotspot/jtreg/runtime/NMT/CommandLineEmptyArgument.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
2424
/*
2525
* @test
2626
* @summary Empty argument to NMT should result in an informative error message
27+
* @requires vm.flagless
2728
* @library /test/lib
2829
* @modules java.base/jdk.internal.misc
2930
* java.management

test/hotspot/jtreg/runtime/NMT/CommandLineInvalidArgument.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
2424
/*
2525
* @test
2626
* @summary Invalid argument to NMT should result in an informative error message
27+
* @requires vm.flagless
2728
* @library /test/lib
2829
* @modules java.base/jdk.internal.misc
2930
* java.management

test/hotspot/jtreg/runtime/NMT/CommandLineSummary.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@ public class CommandLineSummary {
3737

3838
public static void main(String args[]) throws Exception {
3939

40-
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
40+
ProcessBuilder pb = ProcessTools.createTestJvm(
4141
"-XX:NativeMemoryTracking=summary",
4242
"-version");
4343
OutputAnalyzer output = new OutputAnalyzer(pb.start());

test/hotspot/jtreg/runtime/NMT/CommandLineTurnOffNMT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
2424
/*
2525
* @test
2626
* @summary Turning off NMT should not result in an error
27+
* @requires vm.flagless
2728
* @library /test/lib
2829
* @modules java.base/jdk.internal.misc
2930
* java.management

test/hotspot/jtreg/runtime/NMT/JcmdWithNMTDisabled.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
2424
/*
2525
* @test
2626
* @summary Verify that jcmd correctly reports that NMT is not enabled
27+
* @requires vm.flagless
2728
* @library /test/lib
2829
* @modules java.base/jdk.internal.misc
2930
* java.management

test/hotspot/jtreg/runtime/NMT/MallocLimitTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2022 SAP SE. All rights reserved.
3-
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
2626
/*
2727
* @test id=global-limit-fatal
2828
* @summary Verify -XX:MallocLimit with a global limit
29+
* @requires vm.flagless
2930
* @modules java.base/jdk.internal.misc
3031
* @library /test/lib
3132
* @run driver MallocLimitTest global-limit-fatal
@@ -34,6 +35,7 @@
3435
/*
3536
* @test id=global-limit-oom
3637
* @summary Verify -XX:MallocLimit with a global limit
38+
* @requires vm.flagless
3739
* @modules java.base/jdk.internal.misc
3840
* @library /test/lib
3941
* @run driver MallocLimitTest global-limit-oom
@@ -42,6 +44,7 @@
4244
/*
4345
* @test id=compiler-limit-fatal
4446
* @summary Verify -XX:MallocLimit with a compiler-specific limit (for "mtCompiler" category)
47+
* @requires vm.flagless
4548
* @modules java.base/jdk.internal.misc
4649
* @library /test/lib
4750
* @run driver MallocLimitTest compiler-limit-fatal
@@ -50,6 +53,7 @@
5053
/*
5154
* @test id=compiler-limit-oom
5255
* @summary Verify -XX:MallocLimit with a compiler-specific limit (for "mtCompiler" category)
56+
* @requires vm.flagless
5357
* @modules java.base/jdk.internal.misc
5458
* @library /test/lib
5559
* @run driver MallocLimitTest compiler-limit-oom
@@ -58,6 +62,7 @@
5862
/*
5963
* @test id=multi-limit
6064
* @summary Verify -XX:MallocLimit with multiple limits
65+
* @requires vm.flagless
6166
* @modules java.base/jdk.internal.misc
6267
* @library /test/lib
6368
* @run driver MallocLimitTest multi-limit
@@ -66,6 +71,7 @@
6671
/*
6772
* @test id=limit-without-nmt
6873
* @summary Verify that the VM warns if -XX:MallocLimit is given but NMT is disabled
74+
* @requires vm.flagless
6975
* @modules java.base/jdk.internal.misc
7076
* @library /test/lib
7177
* @run driver MallocLimitTest limit-without-nmt

test/hotspot/jtreg/runtime/NMT/NMTInitializationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2021 SAP SE. All rights reserved.
3-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -156,7 +156,7 @@ public static void main(String args[]) throws Exception {
156156
}
157157
vmArgs.add("-version");
158158

159-
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vmArgs);
159+
ProcessBuilder pb = ProcessTools.createTestJvm(vmArgs);
160160
OutputAnalyzer output = new OutputAnalyzer(pb.start());
161161
if (debug) {
162162
output.reportDiagnosticSummary();

test/hotspot/jtreg/runtime/NMT/NMTWithCDS.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -38,14 +38,14 @@ public class NMTWithCDS {
3838

3939
public static void main(String[] args) throws Exception {
4040
ProcessBuilder pb;
41-
pb = ProcessTools.createJavaProcessBuilder(
41+
pb = ProcessTools.createTestJvm(
4242
"-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./NMTWithCDS.jsa", "-Xshare:dump", "-Xlog:cds");
4343
OutputAnalyzer output = new OutputAnalyzer(pb.start());
4444
try {
4545
output.shouldContain("Loading classes to share");
4646
output.shouldHaveExitValue(0);
4747

48-
pb = ProcessTools.createJavaProcessBuilder(
48+
pb = ProcessTools.createTestJvm(
4949
"-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=detail", "-XX:SharedArchiveFile=./NMTWithCDS.jsa", "-Xshare:on", "-version");
5050
output = new OutputAnalyzer(pb.start());
5151
output.shouldContain("sharing");

test/hotspot/jtreg/runtime/NMT/PrintNMTStatistics.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -37,7 +37,7 @@ public class PrintNMTStatistics {
3737

3838
public static void main(String args[]) throws Exception {
3939

40-
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
40+
ProcessBuilder pb = ProcessTools.createTestJvm(
4141
"-XX:+UnlockDiagnosticVMOptions",
4242
"-XX:+PrintNMTStatistics",
4343
"-XX:NativeMemoryTracking=detail",
@@ -55,7 +55,7 @@ public static void main(String args[]) throws Exception {
5555
// Make sure memory reserved for Module processing is recorded.
5656
output_detail.shouldContain(" Module (reserved=");
5757

58-
ProcessBuilder pb1 = ProcessTools.createJavaProcessBuilder(
58+
ProcessBuilder pb1 = ProcessTools.createTestJvm(
5959
"-XX:+UnlockDiagnosticVMOptions",
6060
"-XX:+PrintNMTStatistics",
6161
"-XX:NativeMemoryTracking=summary",

0 commit comments

Comments
 (0)