提交 cb3b9dd3 编写于 作者: A avorobye

8044772: TempDirTest.java still times out with -Xcomp

Reviewed-by: coffeys
上级 1596061b
...@@ -139,12 +139,19 @@ public class RunnerUtil { ...@@ -139,12 +139,19 @@ public class RunnerUtil {
String content = null; String content = null;
// Read file or wait for it to be created. // Read file or wait for it to be created.
long startTime = System.currentTimeMillis();
long lastWarningTime = 0;
while (true) { while (true) {
content = readFile(file); content = readFile(file);
if (content != null && content.indexOf("done") >= 0) { if (content != null && content.indexOf("done") >= 0) {
break; break;
} }
Thread.sleep(100); Thread.sleep(100);
long elapsedTime = (System.currentTimeMillis() - startTime) / 1000;
if (elapsedTime > lastWarningTime) {
lastWarningTime = elapsedTime;
System.out.println("Waited " + elapsedTime + " seconds for file.");
}
} }
ProcessInfo info = new ProcessInfo(); ProcessInfo info = new ProcessInfo();
......
...@@ -39,13 +39,22 @@ import jdk.testlibrary.ProcessThread; ...@@ -39,13 +39,22 @@ import jdk.testlibrary.ProcessThread;
* @summary Test to make sure attach and jvmstat works correctly when java.io.tmpdir is set * @summary Test to make sure attach and jvmstat works correctly when java.io.tmpdir is set
* @library /lib/testlibrary * @library /lib/testlibrary
* @run build Application Shutdown RunnerUtil * @run build Application Shutdown RunnerUtil
* @run main/timeout=10 TempDirTest * @run main/timeout=200 TempDirTest
*/
/*
* This test runs with an extra long timeout since it takes a really long time with -Xcomp
* when starting many processes.cd /
*/ */
public class TempDirTest { public class TempDirTest {
private static long startTime;
public static void main(String args[]) throws Throwable { public static void main(String args[]) throws Throwable {
startTime = System.currentTimeMillis();
Path clientTmpDir = Files.createTempDirectory("TempDirTest-client"); Path clientTmpDir = Files.createTempDirectory("TempDirTest-client");
clientTmpDir.toFile().deleteOnExit(); clientTmpDir.toFile().deleteOnExit();
Path targetTmpDir = Files.createTempDirectory("TempDirTest-target"); Path targetTmpDir = Files.createTempDirectory("TempDirTest-target");
...@@ -76,6 +85,9 @@ public class TempDirTest { ...@@ -76,6 +85,9 @@ public class TempDirTest {
System.out.print(" target: " + (targetTmpDir == null ? "no" : "yes")); System.out.print(" target: " + (targetTmpDir == null ? "no" : "yes"));
System.out.println(" ###"); System.out.println(" ###");
long elapsedTime = (System.currentTimeMillis() - startTime) / 1000;
System.out.println("Started after " + elapsedTime + "s");
final String pidFile = "TempDirTest.Application.pid-" + counter++; final String pidFile = "TempDirTest.Application.pid-" + counter++;
ProcessThread processThread = null; ProcessThread processThread = null;
RunnerUtil.ProcessInfo info = null; RunnerUtil.ProcessInfo info = null;
...@@ -95,6 +107,10 @@ public class TempDirTest { ...@@ -95,6 +107,10 @@ public class TempDirTest {
// Make sure the Application process is stopped. // Make sure the Application process is stopped.
RunnerUtil.stopApplication(info.shutdownPort, processThread); RunnerUtil.stopApplication(info.shutdownPort, processThread);
} }
elapsedTime = (System.currentTimeMillis() - startTime) / 1000;
System.out.println("Completed after " + elapsedTime + "s");
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册