Skip to content

Conversation

@reswqa
Copy link
Member

@reswqa reswqa commented Mar 11, 2023

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 a future will not be completed in a certain time. For example, JobMasterServiceLeadershipRunnerTest#testConcurrentLeadershipOperationsBlockingClose. This logic was first covered by org.apache.flink.core.testutils.FlinkMatchers#willNotComplete, and then depends on the failsWithin timeout mechanism after migrating to assertJ. In order not to change the original test logic, the timeout here has not been removed.

Brief change log

  • Refactor tests to git rid of timeout of CompletableFuture assertions..

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:

  • 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, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no

@flinkbot
Copy link
Collaborator

flinkbot commented Mar 11, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@TanYuxin-tyx TanYuxin-tyx left a 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.

@reswqa reswqa force-pushed the FLINK-31405-remove-timeout branch from bc18924 to c9b7ee7 Compare March 16, 2023 09:03
@reswqa
Copy link
Member Author

reswqa commented Mar 16, 2023

Thanks @TanYuxin-tyx for the review, I have migrated AdaptiveSchedulerTest to Junit5 in a hotfix commit and updated other comments in a fix-up commit. PTAL again.

@TanYuxin-tyx
Copy link
Contributor

@reswqa LGTM after addressing comments. But it has not triggered tests, let's start it.

@TanYuxin-tyx
Copy link
Contributor

@flinkbot run azure

reswqa added 2 commits March 17, 2023 00:00
…bleFutureAssert.

This is a replacement for FlinkMatchers#willNotComplete(Duration) in assertj.
@reswqa reswqa force-pushed the FLINK-31405-remove-timeout branch from c9b7ee7 to 9280f51 Compare March 16, 2023 16:01
@reswqa
Copy link
Member Author

reswqa commented Mar 16, 2023

Rebase it, merged % Azure green.

@reswqa
Copy link
Member Author

reswqa commented Mar 17, 2023

@flinkbot run azure

@reswqa reswqa closed this in d88f39c Mar 20, 2023
RocMarshal pushed a commit to RocMarshal/flink that referenced this pull request May 9, 2024
…leFuture assertions.

This closes apache#22161

(cherry picked from commit d88f39c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants