zentol commented on a change in pull request #10637: [FLINK-15319][e2e] 
flink-end-to-end-tests-common-kafka fails due to t…
URL: https://github.com/apache/flink/pull/10637#discussion_r364709925
 
 

 ##########
 File path: 
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/AutoClosableProcess.java
 ##########
 @@ -117,14 +117,13 @@ public void runBlocking(final Duration timeout) throws 
IOException {
 
                public void runBlockingWithRetry(final int maxRetries, final 
Duration attemptTimeout, final Duration globalTimeout) throws IOException {
                        int retries = 0;
-                       Duration remainTimeout = globalTimeout;
+                       long expectedTimeMillis = System.currentTimeMillis() + 
globalTimeout.toMillis();
 
 Review comment:
   You can simplify the global timeout handling by converting it to a 
`Deadline` and using `#hasTimeLeft` as the exit condition:
   ```
   Deadline deadline = Deadline.fromNow(globalTimeout);
   while (true) {
        ...
        } catch (Exception e) {
                if (++retries > maxRetries || !deadline.hasTimeLeft) {
                        ...
   ```

----------------------------------------------------------------
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

Reply via email to