-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b93
Currently the spec for onExit() of Process and ProcessHandle states:
"If the process is not alive the CompletableFuture returned has been completed."
This assertion need to be relaxed, because after the process has been terminated some time is needed for completing of CompletableFuture.
For example, the following code may print false:
Process process = ...;
ProcessHandle ph = process.toHandle();
process.waitFor();
// on this step the process is already terminated and isAlive() should return false
CompletableFuture<ProcessHandle> completableFuture = ph.onExit();
System.out.println(completableFuture.isDone());
"If the process is not alive the CompletableFuture returned has been completed."
This assertion need to be relaxed, because after the process has been terminated some time is needed for completing of CompletableFuture.
For example, the following code may print false:
Process process = ...;
ProcessHandle ph = process.toHandle();
process.waitFor();
// on this step the process is already terminated and isAlive() should return false
CompletableFuture<ProcessHandle> completableFuture = ph.onExit();
System.out.println(completableFuture.isDone());