Skip to content

Commit 9c29d00

Browse files
committed
8243568: serviceability/logging/TestLogRotation.java uses 'test.java.opts' and not 'test.vm.opts'
Backport-of: 8065665
1 parent 3fbcd78 commit 9c29d00

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

test/hotspot/jtreg/serviceability/logging/TestLogRotation.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2020, 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
@@ -27,7 +27,7 @@
2727
* @library /test/lib
2828
* @modules java.base/jdk.internal.misc
2929
* java.management
30-
* @run main/othervm/timeout=600 TestLogRotation
30+
* @run driver/timeout=600 TestLogRotation
3131
*
3232
*/
3333
import jdk.test.lib.process.ProcessTools;
@@ -78,16 +78,10 @@ public static void runTest(int numberOfFiles) throws Exception {
7878
"-Xlog:gc=debug:" + logFileName + "::filesize=" + logFileSizeK + "k,filecount=" + numberOfFiles,
7979
"-XX:-DisableExplicitGC", // to ensure that System.gc() works
8080
"-Xmx128M"};
81-
// System.getProperty("test.java.opts") is '' if no options is set
82-
// need to skip such empty
83-
String[] externalVMopts = System.getProperty("test.java.opts").length() == 0
84-
? new String[0]
85-
: System.getProperty("test.java.opts").split(" ");
86-
args.addAll(Arrays.asList(externalVMopts));
8781
args.addAll(Arrays.asList(logOpts));
8882
args.add(GCLoggingGenerator.class.getName());
8983
args.add(String.valueOf(numberOfFiles * logFileSizeK * 1024));
90-
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args.toArray(new String[0]));
84+
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, args.toArray(String[]::new));
9185
pb.redirectErrorStream(true);
9286
pb.redirectOutput(new File(GCLoggingGenerator.class.getName() + ".log"));
9387
Process process = pb.start();

0 commit comments

Comments
 (0)