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 2022/06/15 13:44:47 UTC

[GitHub] [flink] RyanSkraba opened a new pull request, #19970: [FLINK-27885][tests][JUnit5 migration] flink-hadoop-bulk

RyanSkraba opened a new pull request, #19970:
URL: https://github.com/apache/flink/pull/19970

   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   Update the `flink-formats/flink-hadoop-bulk` module to AssertJ and JUnit 5 following the [JUnit 5 Migration Guide](https://docs.google.com/document/d/1514Wa_aNB9bJUen4xm5uiuXOooOJTtXqS_Jqk9KJitU/edit)
   
   ## Brief change log
   
   * Removed dependences on JUnit 4, JUnit 5 Assertions and Hamcrest where possible.
   
   ## Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   I've verified that there are 31 tests run in this module before and after the refactoring.
   
   ## 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


-- 
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] XComp commented on a diff in pull request #19970: [FLINK-27970][tests][JUnit5 migration] flink-hadoop-bulk

Posted by "XComp (via GitHub)" <gi...@apache.org>.
XComp commented on code in PR #19970:
URL: https://github.com/apache/flink/pull/19970#discussion_r1102841851


##########
flink-formats/flink-hadoop-bulk/archunit-violations/db4de53e-d09e-4fb0-bdbc-429c1b64686f:
##########
@@ -0,0 +1,12 @@
+org.apache.flink.formats.hadoop.bulk.committer.HadoopRenameCommitterHDFSITCase does not satisfy: only one of the following predicates match:\

Review Comment:
   Why is this added? It looks like there is some problem with the archunit tests and subclasses? :thinking: 



-- 
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


Re: [PR] [FLINK-27970][tests][JUnit5 migration] flink-hadoop-bulk [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #19970:
URL: https://github.com/apache/flink/pull/19970#discussion_r1497122598


##########
flink-formats/flink-hadoop-bulk/src/test/java/org/apache/flink/formats/hadoop/bulk/AbstractFileCommitterTest.java:
##########
@@ -232,7 +227,7 @@ private void verifyFileNotExists(
         FileSystem fileSystem = FileSystem.get(basePath.toUri(), configuration);
         for (String targetFileName : targetFileNames) {
             assertThat(fileSystem.exists(new Path(basePath, targetFileName)))
-                    .as("Pre-committed file should not exists: " + targetFileName)
+                    .as("Pre-committed file should not exist: " + targetFileName)

Review Comment:
   Agree about the points you've mentioned
   I suggested that since it seems it is becoming a common approach, e.g. similar things are quite often in Calcite and othe projects...
   anyway I'm not insisting on this, up to @RyanSkraba 



-- 
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


Re: [PR] [FLINK-27970][tests][JUnit5 migration] flink-hadoop-bulk [flink]

Posted by "XComp (via GitHub)" <gi...@apache.org>.
XComp commented on code in PR #19970:
URL: https://github.com/apache/flink/pull/19970#discussion_r1497091046


##########
flink-formats/flink-hadoop-bulk/src/test/java/org/apache/flink/formats/hadoop/bulk/AbstractFileCommitterTest.java:
##########
@@ -232,7 +227,7 @@ private void verifyFileNotExists(
         FileSystem fileSystem = FileSystem.get(basePath.toUri(), configuration);
         for (String targetFileName : targetFileNames) {
             assertThat(fileSystem.exists(new Path(basePath, targetFileName)))
-                    .as("Pre-committed file should not exists: " + targetFileName)
+                    .as("Pre-committed file should not exist: " + targetFileName)

Review Comment:
   interesting feature. I didn't notice that before. But keep in mind two things when writing code:
   1. There's also a trade-off between readability and performance improvement: Not every performance-related change is needed/useful. Here we have a test implementation where we don't need to worry too much about the performance of a String operation in case of a failure. Readability (i.e. less code) might be preferable here because the additional code snippet doesn't add any value. ...at least as far as I can see.
   2. "Workarounds" that are way more "uncommon" in the code base might cause hotfix PRs later on by contributors who do not know this particular feature (which increases the review efforts on the committers' side or, at least, increases the projects PR count). I see that specific risk for this change proposal here. But to be fair, that's a subjective judgement on my end.



-- 
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] RyanSkraba commented on a diff in pull request #19970: [FLINK-27970][tests][JUnit5 migration] flink-hadoop-bulk

Posted by "RyanSkraba (via GitHub)" <gi...@apache.org>.
RyanSkraba commented on code in PR #19970:
URL: https://github.com/apache/flink/pull/19970#discussion_r1304598612


##########
flink-formats/flink-hadoop-bulk/archunit-violations/db4de53e-d09e-4fb0-bdbc-429c1b64686f:
##########
@@ -0,0 +1,12 @@
+org.apache.flink.formats.hadoop.bulk.committer.HadoopRenameCommitterHDFSITCase does not satisfy: only one of the following predicates match:\

Review Comment:
   I've removed these exceptions -- it looks like this was a consequence of having the (require) `MiniClusterExtension` being present through the abstract base class, instead of the direct implementation.



-- 
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] snuyanzin commented on a diff in pull request #19970: [FLINK-27970][tests][JUnit5 migration] flink-hadoop-bulk

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #19970:
URL: https://github.com/apache/flink/pull/19970#discussion_r1304691650


##########
flink-formats/flink-hadoop-bulk/src/test/java/org/apache/flink/streaming/api/functions/sink/filesystem/HadoopPathBasedBulkFormatBuilderTest.java:
##########
@@ -25,17 +25,17 @@
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
-import org.junit.Assume;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.lang.reflect.Constructor;
 import java.net.URL;
 import java.net.URLClassLoader;
 
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;

Review Comment:
   shouldn't it be assertj's `org.assertj.core.api.Assumptions.assumeThat` ?



-- 
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


Re: [PR] [FLINK-27970][tests][JUnit5 migration] flink-hadoop-bulk [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #19970:
URL: https://github.com/apache/flink/pull/19970#discussion_r1497054284


##########
flink-formats/flink-hadoop-bulk/src/test/java/org/apache/flink/formats/hadoop/bulk/AbstractFileCommitterTest.java:
##########
@@ -245,7 +240,7 @@ private void verifyCommittedFiles(
         for (String targetFileName : targetFileNames) {
             Path targetFilePath = new Path(basePath, targetFileName);
             assertThat(fileSystem.exists(targetFilePath))
-                    .as("Committed file should exists: " + targetFileName)
+                    .as("Committed file should exist: " + targetFileName)

Review Comment:
   ```suggestion
                       .as(() -> "Committed file should exist: " + targetFileName)
   ```
   we can use suppliers in order to concat string only in case of failure and do not dot it for success cases



-- 
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


Re: [PR] [FLINK-27970][tests][JUnit5 migration] flink-hadoop-bulk [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on PR #19970:
URL: https://github.com/apache/flink/pull/19970#issuecomment-1956086408

   In general it looks good to me 
   thanks for working on it @RyanSkraba :+1: 
   
   I left some minor comments


-- 
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


Re: [PR] [FLINK-27970][tests][JUnit5 migration] flink-hadoop-bulk [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #19970:
URL: https://github.com/apache/flink/pull/19970#discussion_r1497053799


##########
flink-formats/flink-hadoop-bulk/src/test/java/org/apache/flink/formats/hadoop/bulk/AbstractFileCommitterTest.java:
##########
@@ -232,7 +227,7 @@ private void verifyFileNotExists(
         FileSystem fileSystem = FileSystem.get(basePath.toUri(), configuration);
         for (String targetFileName : targetFileNames) {
             assertThat(fileSystem.exists(new Path(basePath, targetFileName)))
-                    .as("Pre-committed file should not exists: " + targetFileName)
+                    .as("Pre-committed file should not exist: " + targetFileName)

Review Comment:
   very nit:
   ```suggestion
                       .as(() -> "Pre-committed file should not exist: " + targetFileName)
   ```
   we can use suppliers in order to concat string only in case of failure and do not dot it for success cases



-- 
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] RyanSkraba commented on pull request #19970: [FLINK-27970][tests][JUnit5 migration] flink-hadoop-bulk

Posted by GitBox <gi...@apache.org>.
RyanSkraba commented on PR #19970:
URL: https://github.com/apache/flink/pull/19970#issuecomment-1158867140

   @flinkbot run azure


-- 
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


Re: [PR] [FLINK-27970][tests][JUnit5 migration] flink-hadoop-bulk [flink]

Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin commented on code in PR #19970:
URL: https://github.com/apache/flink/pull/19970#discussion_r1497055305


##########
flink-formats/flink-hadoop-bulk/src/test/java/org/apache/flink/formats/hadoop/bulk/HadoopPathBasedPendingFileRecoverableSerializerMigrationTest.java:
##########
@@ -62,10 +49,8 @@ public static Collection<Integer> previousVersions() {
             Paths.get("src/test/resources/")
                     .resolve("pending-file-recoverable-serializer-migration");
 
-    @ClassRule public static TemporaryFolder tempFolder = new TemporaryFolder();
-
     @Test
-    @Ignore
+    @Disabled
     public void prepareDeserialization() throws IOException {

Review Comment:
   should we also harden modifier here?



-- 
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] flinkbot commented on pull request #19970: [FLINK-27970][tests][JUnit5 migration] flink-hadoop-bulk

Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #19970:
URL: https://github.com/apache/flink/pull/19970#issuecomment-1156499500

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "df2474700f5533c675a529b0333ff671030013a7",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "df2474700f5533c675a529b0333ff671030013a7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * df2474700f5533c675a529b0333ff671030013a7 UNKNOWN
   
   <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] RyanSkraba commented on pull request #19970: [FLINK-27970][tests][JUnit5 migration] flink-hadoop-bulk

Posted by GitBox <gi...@apache.org>.
RyanSkraba commented on PR #19970:
URL: https://github.com/apache/flink/pull/19970#issuecomment-1397364945

   Hello!  I've rebased this PR to master and fixed the merge conflicts in the meantime.
   
   I will be mostly away from my computer for a couple of weeks, but I'll check in if anything 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.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org