8337300: java/lang/Process/WaitForDuration.java leaves child process behind
Reviewed-by: alanb, iris, bpb
This commit is contained in:
parent
ee365d75cc
commit
c23d37e10a
@ -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…
x
Reference in New Issue
Block a user