New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Awaitility to instead of Thread sheep method. #389
Conversation
mattisonchao
commented
Jul 2, 2021
- Use Awaitility to avoid busy waiting.
- Refactor some code to Java8
- Use awaitility to avoid busy waiting. - Refactor some code to Java8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
we are using a lot Awaiatility in Apache Pulsar.
would you like to follow up and enhance more tests ?
@tisonkun @Randgalt @cammckenzie I like Awaitility, we started to use it in Pulsar in order to make tests code cleaner and in general reduce flakyness |
Sure, I will do that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for your work!
I'd suggest separate a commit to refactor lambda expression for your next contributions @mattisonchao
{ | ||
Thread.sleep(100); | ||
} | ||
Awaitility.await() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you are adding an implicit timeout of 10 seconds
I am fine with it, as far as it does not make the test become flaky
@mattisonchao I have merged this PR. but in Curator we use JIRA to track the work can you please create a ticket here and link it to this PR ? Usually we require that the commit message reports the JIRA ticket ID. @tisonkun I was too quick in using the Git Hub merge button :( |