You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yun Gao (Jira)" <ji...@apache.org> on 2022/04/13 06:28:05 UTC

[jira] [Updated] (FLINK-21564) CommonTestUtils.waitUntilCondition could fail with condition meets before

     [ https://issues.apache.org/jira/browse/FLINK-21564?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yun Gao updated FLINK-21564:
----------------------------
    Fix Version/s: 1.16.0

> CommonTestUtils.waitUntilCondition could fail with condition meets before
> -------------------------------------------------------------------------
>
>                 Key: FLINK-21564
>                 URL: https://issues.apache.org/jira/browse/FLINK-21564
>             Project: Flink
>          Issue Type: Bug
>          Components: Tests
>            Reporter: Kezhu Wang
>            Assignee: Pedro Silva
>            Priority: Minor
>              Labels: auto-unassigned, pull-request-available, stale-assigned
>             Fix For: 1.15.0, 1.16.0
>
>
> {code}
>     public static void waitUntilCondition(
>             SupplierWithException<Boolean, Exception> condition,
>             Deadline timeout,
>             long retryIntervalMillis,
>             String errorMsg)
>             throws Exception {
>         while (timeout.hasTimeLeft() && !condition.get()) {
>             final long timeLeft = Math.max(0, timeout.timeLeft().toMillis());
>             Thread.sleep(Math.min(retryIntervalMillis, timeLeft));
>         }
>         if (!timeout.hasTimeLeft()) {
>             throw new TimeoutException(errorMsg);
>         }
>     }
> {code}
> The timeout could run off between truth condition and last checking.
> Besides this, I also see time-out blocking condition in some tests, the combination could be worse.
> Not a big issue, but worth to be aware of and solved.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)