-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-31405] Refactor tests to git rid of timeout of CompletableFuture assertions. #22161
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
Conversation
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.
Thanks @reswqa for improving the timeout tests.
Looks good to me in total. I only left some minor comments about the tests and the printed message format.
...runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveSchedulerTest.java
Show resolved
Hide resolved
...-utils-junit/src/main/java/org/apache/flink/core/testutils/FlinkCompletableFutureAssert.java
Show resolved
Hide resolved
...-utils-junit/src/main/java/org/apache/flink/core/testutils/FlinkCompletableFutureAssert.java
Outdated
Show resolved
Hide resolved
bc18924 to
c9b7ee7
Compare
|
Thanks @TanYuxin-tyx for the review, I have migrated |
|
@reswqa LGTM after addressing comments. But it has not triggered tests, let's start it. |
|
@flinkbot run azure |
…bleFutureAssert. This is a replacement for FlinkMatchers#willNotComplete(Duration) in assertj.
…leFuture assertions.
c9b7ee7 to
9280f51
Compare
|
Rebase it, merged % Azure green. |
|
@flinkbot run azure |
…leFuture assertions. This closes apache#22161 (cherry picked from commit d88f39c)
What is the purpose of the change
In general, we want to avoid relying on local timeouts in the Flink test suite to get additional context (thread dump) in case something gets stuck(see Code Style and Quality Guide).
Some of timeout in tests are introduced by assertions for CompleteFuture. After FLINK-31385, we can refactor these tests to git rid of timeout for CompletableFuture assertions.
In the process of removing all assertions with timeout for
CompletableFuture, I found that some tests actually want to assert that afuturewill not be completed in a certain time. For example,JobMasterServiceLeadershipRunnerTest#testConcurrentLeadershipOperationsBlockingClose. This logic was first covered byorg.apache.flink.core.testutils.FlinkMatchers#willNotComplete, and then depends on thefailsWithintimeout mechanism after migrating toassertJ. In order not to change the original test logic, the timeout here has not been removed.Brief change log
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation