|
1 | 1 | /* |
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. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
27 | 27 | * @library /test/lib |
28 | 28 | * @modules java.base/jdk.internal.misc |
29 | 29 | * java.management |
30 | | - * @run main/othervm/timeout=600 TestLogRotation |
| 30 | + * @run driver/timeout=600 TestLogRotation |
31 | 31 | * |
32 | 32 | */ |
33 | 33 | import jdk.test.lib.process.ProcessTools; |
@@ -78,16 +78,10 @@ public static void runTest(int numberOfFiles) throws Exception { |
78 | 78 | "-Xlog:gc=debug:" + logFileName + "::filesize=" + logFileSizeK + "k,filecount=" + numberOfFiles, |
79 | 79 | "-XX:-DisableExplicitGC", // to ensure that System.gc() works |
80 | 80 | "-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)); |
87 | 81 | args.addAll(Arrays.asList(logOpts)); |
88 | 82 | args.add(GCLoggingGenerator.class.getName()); |
89 | 83 | 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)); |
91 | 85 | pb.redirectErrorStream(true); |
92 | 86 | pb.redirectOutput(new File(GCLoggingGenerator.class.getName() + ".log")); |
93 | 87 | Process process = pb.start(); |
|
0 commit comments