Repository navigation
Flink: Remove the MiniClusterWithClientResource dependency - #13021
Conversation
…( remove @deprecated annotations no longer needed after JUnit5 migration )
|
@nastra |
|
Hello, I successfully ran However, the CI/CD pipeline is showing a failure. Is there possibly something wrong? Should I have run I would sincerely appreciate any feedback regarding this and the code I submitted in the PR. Thank you. |
The And, Spark CI failure looks hitting #12889. You can check the error reason on your local or the CI runs. For the flink test, the test lookup seems to fail. |
| void testErrorOnNullForRequiredField() throws Exception { | ||
| Assume.assumeFalse( | ||
| "ORC file format supports null values even for required fields.", format == FileFormat.ORC); | ||
|
|
There was a problem hiding this comment.
Nit: Plese remove this line.
…estIcebergSink.java
|
@JeonDaehong can you please remove the dependency in Line 413 in a5bcacd |
| throws Exception { | ||
| MiniClusterWithClientResource miniCluster = null; | ||
| try { | ||
| miniCluster = new MiniClusterWithClientResource(MINI_CLUSTER_RESOURCE_CONFIG); |
There was a problem hiding this comment.
is there a way to also inject MINI_CLUSTER_RESOURCE_CONFIG?
There was a problem hiding this comment.
@nastra I believe the MiniClusterExtension with the @RegisterExtension annotation sets the configuration to miniCluster via the @InjectMiniCluster annotation when I checked it (if I'm wrong, please correct me)
There was a problem hiding this comment.
the issue is that the tests are timing out now without the config:
TestIcebergSourceFailover > testBoundedWithJobManagerFailover(MiniCluster) FAILED
java.util.concurrent.TimeoutException: testBoundedWithJobManagerFailover(org.apache.flink.runtime.minicluster.MiniCluster) timed out after 120 seconds
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
TestIcebergSourceFailover > testBoundedWithTaskManagerFailover(MiniCluster) FAILED
java.util.concurrent.TimeoutException: testBoundedWithTaskManagerFailover(org.apache.flink.runtime.minicluster.MiniCluster) timed out after 120 seconds
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
TestIcebergSourceFailoverWithWatermarkExtractor > testBoundedWithJobManagerFailover(MiniCluster) FAILED
java.util.concurrent.TimeoutException: testBoundedWithJobManagerFailover(org.apache.flink.runtime.minicluster.MiniCluster) timed out after 120 seconds
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
TestIcebergSourceFailoverWithWatermarkExtractor > testBoundedWithTaskManagerFailover(MiniCluster) FAILED
java.util.concurrent.TimeoutException: testBoundedWithTaskManagerFailover(org.apache.flink.runtime.minicluster.MiniCluster) timed out after 120 seconds
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
[IOManagerAsync shutdown hook] INFO org.apache.flink.runtime.io.disk.FileChannelManagerImpl - FileChannelManager removed spill file directory /tmp/flink-io-64570821-dedb-45dd-8180-5da4be9b26ac
There was a problem hiding this comment.
Hmm, from my checking, I think the same mini cluster is used for task bounded and task contiunuous tests (as same as job manager tests). When I only run testBoundedWithTaskManagerFailover, it succeeds, but when I run testBoundedWithTaskManagerFailover and testContinuousWithTaskManagerFailover in the same test run, the testContinuousWithTaskManagerFailover is timed out.
For now, the numer of TaskManager is set to 1, so it seems that the other TaskManager failover test waits until the other TaskManager test releases its task manager. When I set the task manager number to 2, both tests for TaskManager succeed.
There was a problem hiding this comment.
@nastra What do you think about adding this cluster start and close for each test?
@BeforeEach
protected void startMiniCluster(@InjectMiniCluster MiniCluster miniCluster) throws Exception {
if (!miniCluster.isRunning()) {
miniCluster.start();
}
}
@AfterEach
protected void stopMiniCluster(@InjectMiniCluster MiniCluster miniCluster) throws Exception {
miniCluster.close();
}There was a problem hiding this comment.
Since this is my first contribution, everything feels quite difficult...
I’m really sorry to keep asking questions, but I would really appreciate a bit more guidance.
From what I’ve checked, most of the code has already been migrated to JUnit 5. I'm currently a bit unsure about what exactly I should be working on (I’m struggling to figure out the right direction).
My understanding was that I should update the code so that the project can be built even after removing testImplementation libs.junit.vintage.engine from the Flink-related Gradle configuration. But now I’m wondering if I may have misunderstood something.
Since it’s my first contribution, I really want to do a good job — I’m sorry again for asking so many questions…! 😢
There was a problem hiding this comment.
@JeonDaehong no worries at all. Basically your change here makes sense and we should get it in once tests are passing (they were timing out for me locally). The idea was also to exclude JUnit 4 from the Flink testing dependencies but I don't think this is currently possible, which you've already seen via the error in #13021 (comment).
Everything else was already handled in #12938 and I've opened #13049 as a long-term goal that we'd eventually like to have (but that's quite difficult right now because there are still some dependencies that pull in JUnit4 themselves)
There was a problem hiding this comment.
Thank you for your response ! :D
In that case, should I leave the PR open as it is and wait, or would it be better for me to make additional changes to ensure the tests pass? 🤔
Also, regarding the issue of JUnit 4 dependencies being pulled in, I’ll continue to work on it as a long-term goal and discuss it further with the community going forward !! 😁
There was a problem hiding this comment.
@JeonDaehong it would be great to make the Flink tests pass (they are currently timing out due to the change in this PR). Without passing tests we won't be able to merge this
There was a problem hiding this comment.
@nastra
Thank you very much for your kind feedback and for patiently answering all my questions, especially since this is my first time contributing.
I now understand that the changes I made are causing the timeout issues in the Flink tests, and that I’ll need to address them directly to make the tests pass before the PR can be merged.
I’ll make the necessary fixes and submit an updated PR soon.
Thank you again for your support!
|
Thank you both very much for your valuable feedback. I will proceed with running the necessary tests and resubmit the PR once the build succeeds using |
|
Hello ! |
|
Thank you ! |
|
@pvary could you please take a look as well? |
Guosmilesmile
left a comment
There was a problem hiding this comment.
If it's about use @InjectMiniCluster to removing the MiniClusterWithClientResource . LGTM . Soft +1.
|
@JeonDaehong can you please backport the change to earlier Flink versions? |
@nastra Should I apply the same backport to versions 1.19 and 1.20 and push the changes to this PR? Or will this PR be merged as-is, and I should open separate PRs for the backports? |
|
@JeonDaehong you can do the backports as part of this PR |
Yes, understood! If it's possible to merge first, please go ahead and merge it. The backporting won’t take much time. Thank you so much for all your help! :D |
|
Merged to main. @JeonDaehong please proceed with the backport |
Thank you for merging the PR. |
Hello,
Regarding issue #12937, I am submitting a PR for v2.0 first.
I have removed the MiniClusterWithClientResource class, which was still dependent on JUnit4, and have also incorporated changes to the gradle and TestIcebergSink classes.
To build the project, it was necessary to modify the GenericAppenderHelper.java file.
Could you please provide feedback on this? If everything looks good, kindly approve the merge.
If this approach is correct and the merge is complete, I will proceed with backporting to versions 1.20 & 1.19 and submit a PR for those as well.
(I have completed the formatting and build as per the feedback provided on the previously closed PR.)
#12937