mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8243568: serviceability/logging/TestLogRotation.java uses 'test.java.opts' and not 'test.vm.opts'
Reviewed-by: lmesnik, dholmes
This commit is contained in:
parent
0fd64dea3d
commit
806566519a
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -27,7 +27,7 @@
|
||||
* @library /test/lib
|
||||
* @modules java.base/jdk.internal.misc
|
||||
* java.management
|
||||
* @run main/othervm/timeout=600 TestLogRotation
|
||||
* @run driver/timeout=600 TestLogRotation
|
||||
*
|
||||
*/
|
||||
import jdk.test.lib.process.ProcessTools;
|
||||
@ -78,16 +78,10 @@ public class TestLogRotation {
|
||||
"-Xlog:gc=debug:" + logFileName + "::filesize=" + logFileSizeK + "k,filecount=" + numberOfFiles,
|
||||
"-XX:-DisableExplicitGC", // to ensure that System.gc() works
|
||||
"-Xmx128M"};
|
||||
// System.getProperty("test.java.opts") is '' if no options is set
|
||||
// need to skip such empty
|
||||
String[] externalVMopts = System.getProperty("test.java.opts").length() == 0
|
||||
? new String[0]
|
||||
: System.getProperty("test.java.opts").split(" ");
|
||||
args.addAll(Arrays.asList(externalVMopts));
|
||||
args.addAll(Arrays.asList(logOpts));
|
||||
args.add(GCLoggingGenerator.class.getName());
|
||||
args.add(String.valueOf(numberOfFiles * logFileSizeK * 1024));
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args.toArray(new String[0]));
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, args.toArray(String[]::new));
|
||||
pb.redirectErrorStream(true);
|
||||
pb.redirectOutput(new File(GCLoggingGenerator.class.getName() + ".log"));
|
||||
Process process = pb.start();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user