You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/03/23 13:07:15 UTC
[GitHub] [flink] kezhuw opened a new pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
kezhuw opened a new pull request #15344:
URL: https://github.com/apache/flink/pull/15344
## What is the purpose of the change
Improve `CommonTestUtils.waitUntil` to provide strong guarantee that there will be no condition call or exception after condition met.
## Brief change log
* Improve `org.apache.flink.runtime.testutils.CommonTestUtils.waitUntilCondition` to provide strong guarantee described above.
* Improve `org.apache.flink.core.testutils.CommonTestUtils.waitUntil` to provide strong guarantee described above.
## Verifying this change
This change is already covered by existing tests which use above two methods.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (no)
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (no)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable)
--
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:
users@infra.apache.org
[GitHub] [flink] StephanEwen commented on a change in pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
StephanEwen commented on a change in pull request #15344:
URL: https://github.com/apache/flink/pull/15344#discussion_r614767289
##########
File path: flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/core/testutils/CommonTestUtils.java
##########
@@ -198,16 +205,17 @@ public static void assertThrows(
@SuppressWarnings("BusyWait")
public static void waitUtil(Supplier<Boolean> condition, Duration timeout, String errorMsg)
throws TimeoutException, InterruptedException {
- long timeoutMs = timeout.toMillis();
- if (timeoutMs <= 0) {
+ long timeoutNanos = timeout.toNanos();
+ if (timeoutNanos <= 0) {
throw new IllegalArgumentException("The timeout must be positive.");
}
- long startingTime = System.currentTimeMillis();
- while (!condition.get() && System.currentTimeMillis() - startingTime < timeoutMs) {
+ long startingTime = System.nanoTime();
Review comment:
Let's just leave it as it is for now. It is correct, and the slight improvement with Deadline is not worth the big dependency changes.
--
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:
users@infra.apache.org
[GitHub] [flink] kezhuw commented on a change in pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
kezhuw commented on a change in pull request #15344:
URL: https://github.com/apache/flink/pull/15344#discussion_r601523982
##########
File path: flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/core/testutils/CommonTestUtils.java
##########
@@ -198,16 +205,17 @@ public static void assertThrows(
@SuppressWarnings("BusyWait")
public static void waitUtil(Supplier<Boolean> condition, Duration timeout, String errorMsg)
throws TimeoutException, InterruptedException {
- long timeoutMs = timeout.toMillis();
- if (timeoutMs <= 0) {
+ long timeoutNanos = timeout.toNanos();
+ if (timeoutNanos <= 0) {
throw new IllegalArgumentException("The timeout must be positive.");
}
- long startingTime = System.currentTimeMillis();
- while (!condition.get() && System.currentTimeMillis() - startingTime < timeoutMs) {
+ long startingTime = System.nanoTime();
Review comment:
I think we have options here:
1. Keep it as is.
2. Migrate `CommonTestUtils.waitUtil` to `CommonTestUtils.waitUntilCondition`.
3. If 2, we could also provide `Duration` overloads for all exiting `waitUntilCondition` overloads.
What do you think ? The last two options will make this a bit fragment, but all related to `waitXyz`.
--
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:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #15344:
URL: https://github.com/apache/flink/pull/15344#issuecomment-804913184
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8201f39b54a708defd6c87cbaf5cb8dafcf3420",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "b8201f39b54a708defd6c87cbaf5cb8dafcf3420",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b8201f39b54a708defd6c87cbaf5cb8dafcf3420 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #15344:
URL: https://github.com/apache/flink/pull/15344#issuecomment-804895623
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit b8201f39b54a708defd6c87cbaf5cb8dafcf3420 (Tue Mar 23 13:17:44 UTC 2021)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</details>
--
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:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15344:
URL: https://github.com/apache/flink/pull/15344#issuecomment-804913184
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8201f39b54a708defd6c87cbaf5cb8dafcf3420",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15281",
"triggerID" : "b8201f39b54a708defd6c87cbaf5cb8dafcf3420",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b8201f39b54a708defd6c87cbaf5cb8dafcf3420 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15281)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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:
users@infra.apache.org
[GitHub] [flink] kezhuw commented on a change in pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
kezhuw commented on a change in pull request #15344:
URL: https://github.com/apache/flink/pull/15344#discussion_r601500588
##########
File path: flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/core/testutils/CommonTestUtils.java
##########
@@ -198,16 +205,17 @@ public static void assertThrows(
@SuppressWarnings("BusyWait")
public static void waitUtil(Supplier<Boolean> condition, Duration timeout, String errorMsg)
throws TimeoutException, InterruptedException {
- long timeoutMs = timeout.toMillis();
- if (timeoutMs <= 0) {
+ long timeoutNanos = timeout.toNanos();
+ if (timeoutNanos <= 0) {
throw new IllegalArgumentException("The timeout must be positive.");
}
- long startingTime = System.currentTimeMillis();
- while (!condition.get() && System.currentTimeMillis() - startingTime < timeoutMs) {
+ long startingTime = System.nanoTime();
Review comment:
Hmmm, this `CommonTestUtils` resides in `flink-test-utils-junit` package which does not depend on `flink-core` where `Deadline` lives in. More worse, `flink-core` depends on `-junit`. I guess we encounter this due to fact that `flink-test-utils` is more flink related(with scala dependencies) while `-junit` has not flink dependencies.
I guess we have to stop here for this `Duration` version for now.
I think there are candidates for follow up:
* Move `CommonTestUtils`(and other no junit related ?) to `flink-test-utils`. Dependants of `flink-test-utils-junit` are more than `flink-test-utils`. No sure whether some of them might want flink agnostic on purpose.
* Simple renaming to avoid naming clashing on usages.
* Others basing on more through investigation.
--
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:
users@infra.apache.org
[GitHub] [flink] kezhuw commented on pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
kezhuw commented on pull request #15344:
URL: https://github.com/apache/flink/pull/15344#issuecomment-805511312
@flinkbot attention @StephanEwen
--
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:
users@infra.apache.org
[GitHub] [flink] StephanEwen commented on pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
StephanEwen commented on pull request #15344:
URL: https://github.com/apache/flink/pull/15344#issuecomment-821111702
I would merge this into `master` after the 1.13 release branch has been forked, to avoid the changed behavior in 1.13.
--
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:
users@infra.apache.org
[GitHub] [flink] kezhuw commented on a change in pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
kezhuw commented on a change in pull request #15344:
URL: https://github.com/apache/flink/pull/15344#discussion_r601457178
##########
File path: flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/core/testutils/CommonTestUtils.java
##########
@@ -198,16 +205,17 @@ public static void assertThrows(
@SuppressWarnings("BusyWait")
public static void waitUtil(Supplier<Boolean> condition, Duration timeout, String errorMsg)
throws TimeoutException, InterruptedException {
- long timeoutMs = timeout.toMillis();
- if (timeoutMs <= 0) {
+ long timeoutNanos = timeout.toNanos();
+ if (timeoutNanos <= 0) {
throw new IllegalArgumentException("The timeout must be positive.");
}
- long startingTime = System.currentTimeMillis();
- while (!condition.get() && System.currentTimeMillis() - startingTime < timeoutMs) {
+ long startingTime = System.nanoTime();
Review comment:
Did you means wrong `System.currentTimeMillis` ? I think it is implementor's responsibility. As a user, I think `Duration` in api is more friendly, there are many wrapping method `Deadline.fromNow(Duration.of(...))`.
I guess I could use `Deadline` in implementation first ?
--
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:
users@infra.apache.org
[GitHub] [flink] kezhuw commented on a change in pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
kezhuw commented on a change in pull request #15344:
URL: https://github.com/apache/flink/pull/15344#discussion_r601457178
##########
File path: flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/core/testutils/CommonTestUtils.java
##########
@@ -198,16 +205,17 @@ public static void assertThrows(
@SuppressWarnings("BusyWait")
public static void waitUtil(Supplier<Boolean> condition, Duration timeout, String errorMsg)
throws TimeoutException, InterruptedException {
- long timeoutMs = timeout.toMillis();
- if (timeoutMs <= 0) {
+ long timeoutNanos = timeout.toNanos();
+ if (timeoutNanos <= 0) {
throw new IllegalArgumentException("The timeout must be positive.");
}
- long startingTime = System.currentTimeMillis();
- while (!condition.get() && System.currentTimeMillis() - startingTime < timeoutMs) {
+ long startingTime = System.nanoTime();
Review comment:
Did you means wrong `System.currentTimeMillis` ? I think it is implementor's responsibility. As a user, I think `Duration` in api is more friendly, there are many wrapping calls `Deadline.fromNow(Duration.of(...))`.
I guess I could use `Deadline` in implementation first ?
--
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:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15344:
URL: https://github.com/apache/flink/pull/15344#issuecomment-804913184
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8201f39b54a708defd6c87cbaf5cb8dafcf3420",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15281",
"triggerID" : "b8201f39b54a708defd6c87cbaf5cb8dafcf3420",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b8201f39b54a708defd6c87cbaf5cb8dafcf3420 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15281)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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:
users@infra.apache.org
[GitHub] [flink] ppsbs commented on pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
ppsbs commented on pull request #15344:
URL: https://github.com/apache/flink/pull/15344#issuecomment-1026010030
Hi @StephanEwen , I wanted to work on issue [21564](https://issues.apache.org/jira/browse/FLINK-21564), but found this PR that solves it. Could you tell me why it was approved but not merged? Thank you!
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] kezhuw commented on pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
kezhuw commented on pull request #15344:
URL: https://github.com/apache/flink/pull/15344#issuecomment-805510806
Failure is unrelated and reported to FLINK-20329 (Elasticsearch7DynamicSinkITCase hangs).
--
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:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15344:
URL: https://github.com/apache/flink/pull/15344#issuecomment-804895623
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit b8201f39b54a708defd6c87cbaf5cb8dafcf3420 (Fri May 28 09:08:29 UTC 2021)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❗ 3. Needs [attention] from.
- Needs attention by @stephanewen
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</details>
--
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:
users@infra.apache.org
[GitHub] [flink] kezhuw commented on a change in pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
kezhuw commented on a change in pull request #15344:
URL: https://github.com/apache/flink/pull/15344#discussion_r601503664
##########
File path: flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/core/testutils/CommonTestUtils.java
##########
@@ -198,16 +205,17 @@ public static void assertThrows(
@SuppressWarnings("BusyWait")
public static void waitUtil(Supplier<Boolean> condition, Duration timeout, String errorMsg)
throws TimeoutException, InterruptedException {
- long timeoutMs = timeout.toMillis();
- if (timeoutMs <= 0) {
+ long timeoutNanos = timeout.toNanos();
+ if (timeoutNanos <= 0) {
throw new IllegalArgumentException("The timeout must be positive.");
}
- long startingTime = System.currentTimeMillis();
- while (!condition.get() && System.currentTimeMillis() - startingTime < timeoutMs) {
+ long startingTime = System.nanoTime();
Review comment:
Or I could delete `CommonTestUtils.waitUntil` from `flink-test-utils-junit` for now ? I tried, all dependants also depend on `flink-test-utils` currently.
--
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:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15344:
URL: https://github.com/apache/flink/pull/15344#issuecomment-804913184
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "b8201f39b54a708defd6c87cbaf5cb8dafcf3420",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15281",
"triggerID" : "b8201f39b54a708defd6c87cbaf5cb8dafcf3420",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* b8201f39b54a708defd6c87cbaf5cb8dafcf3420 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15281)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] StephanEwen commented on a change in pull request #15344: [FLINK-21564][tests] Don't call condition or throw exception after condition met for CommonTestUtils.waitUntil
Posted by GitBox <gi...@apache.org>.
StephanEwen commented on a change in pull request #15344:
URL: https://github.com/apache/flink/pull/15344#discussion_r601431370
##########
File path: flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/core/testutils/CommonTestUtils.java
##########
@@ -198,16 +205,17 @@ public static void assertThrows(
@SuppressWarnings("BusyWait")
public static void waitUtil(Supplier<Boolean> condition, Duration timeout, String errorMsg)
throws TimeoutException, InterruptedException {
- long timeoutMs = timeout.toMillis();
- if (timeoutMs <= 0) {
+ long timeoutNanos = timeout.toNanos();
+ if (timeoutNanos <= 0) {
throw new IllegalArgumentException("The timeout must be positive.");
}
- long startingTime = System.currentTimeMillis();
- while (!condition.get() && System.currentTimeMillis() - startingTime < timeoutMs) {
+ long startingTime = System.nanoTime();
Review comment:
Can we change this to use `Deadline` as well, to set a good example to not manually use the time functions (which is safer, many contributors get the time functions wrong accidentally).
--
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:
users@infra.apache.org