lgoldstein commented on a change in pull request #115: Add timeout with 
Duration and apply larger timeouts to tests that oft…
URL: https://github.com/apache/mina-sshd/pull/115#discussion_r385158167
 
 

 ##########
 File path: 
sshd-common/src/main/java/org/apache/sshd/common/future/VerifiableFuture.java
 ##########
 @@ -57,6 +58,18 @@ default T verify(long timeout, TimeUnit unit) throws 
IOException {
         return verify(unit.toMillis(timeout));
     }
 
+    /**
+     * Wait and verify that the operation was successful
+     *
+     * @param timeout The maximum duration to wait
+     * @return The (same) future instance
+     * @throws IOException If failed to verify successfully on time
+     * @see #verify(long)
+     */
+    default T verify(Duration timeout) throws IOException {
+        return verify(timeout.toMillis());
 
 Review comment:
   In other locations the  code interprets `null` as *forever* - let's maintain 
this convention (or fix the other code - `ClientChannel#waitFor`)
   ```java
   default T verify(Duration timeout) throws IOException {
       return (duration == null) ? verify() : verify(timeout.toMillis());
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to