Skip to content

Commit

Permalink
8243568: serviceability/logging/TestLogRotation.java uses 'test.java.…
Browse files Browse the repository at this point in the history
…opts' and not 'test.vm.opts'

Reviewed-by: lmesnik, dholmes
  • Loading branch information
iignatev committed Apr 27, 2020
1 parent 0fd64de commit 8065665
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions test/hotspot/jtreg/serviceability/logging/TestLogRotation.java
@@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -78,16 +78,10 @@ public static void runTest(int numberOfFiles) throws Exception {
"-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();
Expand Down

0 comments on commit 8065665

Please sign in to comment.