Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
naotoj committed Jul 28, 2024
1 parent 034297a commit eff87d6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/jdk/java/lang/Process/WaitForDuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,14 @@ static Stream<Arguments> durations() {
@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
Expand Down

0 comments on commit eff87d6

Please sign in to comment.