mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8337300: java/lang/Process/WaitForDuration.java leaves child process behind
Reviewed-by: alanb, iris, bpb
This commit is contained in:
parent
ee365d75cc
commit
c23d37e10a
1 changed files with 8 additions and 3 deletions
|
@ -55,9 +55,14 @@ public class WaitForDuration {
|
|||
@MethodSource("durations")
|
||||
void testEdgeDurations(Duration d, int sleepMillis, boolean expected)
|
||||
throws IOException, InterruptedException {
|
||||
var pb = ProcessTools.createTestJavaProcessBuilder(
|
||||
WaitForDuration.class.getSimpleName(), Integer.toString(sleepMillis));
|
||||
assertEquals(expected, pb.start().waitFor(d));
|
||||
var child = ProcessTools.createTestJavaProcessBuilder(
|
||||
WaitForDuration.class.getSimpleName(), Integer.toString(sleepMillis))
|
||||
.start();
|
||||
try {
|
||||
assertEquals(expected, child.waitFor(d));
|
||||
} finally {
|
||||
child.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue