提交 0c35c163 编写于 作者: R robm

8005618: TEST_BUG: java/lang/ProcessBuilder/Basic.java failing intermittently

Reviewed-by: alanb, martin, dholmes
上级 dd554560
/*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, 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
......@@ -2218,7 +2218,7 @@ public class Basic {
start = System.nanoTime();
p.waitFor(1000, TimeUnit.MILLISECONDS);
end = System.nanoTime();
if ((end - start) > 100000000)
if ((end - start) > 900000000)
fail("Test failed: waitFor took too long on a dead process.");
} catch (Throwable t) { unexpected(t); }
......@@ -2231,11 +2231,13 @@ public class Basic {
childArgs.add("sleep");
final Process p = new ProcessBuilder(childArgs).start();
final long start = System.nanoTime();
final CountDownLatch latch = new CountDownLatch(1);
final Thread thread = new Thread() {
public void run() {
try {
try {
latch.countDown();
p.waitFor(10000, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
return;
......@@ -2244,6 +2246,7 @@ public class Basic {
} catch (Throwable t) { unexpected(t); }}};
thread.start();
latch.await();
Thread.sleep(1000);
thread.interrupt();
p.destroy();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册