Skip to content

Conversation

@wujinhu
Copy link
Contributor

@wujinhu wujinhu commented Dec 30, 2018

What is the purpose of the change

IT cases for filesystems are somewhat similar as they are using write/read cycles and querying meta data like directory listing. We could avoid code duplication now and for the future by introducing an abstract superclass for those it cases that outlines the tests.

Brief change log

  • Add AbstractHadoopFileSystemITTest as the superclass
  • Move common test cases to the superclass and remove them from flink-oss-fs-hadoop/flink-s3-fs-hadoop/flink-s3-fs-presto
  • Add HadoopOSSFileSystemBehaviorITCase for flink-oss-fs-hadoop

Verifying this change

This change does not change the tests logic, so they should be verified as before

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@wujinhu
Copy link
Contributor Author

wujinhu commented Dec 30, 2018

@StefanRRichter Please help to review this PR, thanks.
I will upload test results after you review this PR.
Notice: I do not change tests of flink-swift-fs-hadoop because I do not have the corresponding environment. I think we can leave it to its owner.

@wujinhu
Copy link
Contributor Author

wujinhu commented Jan 7, 2019

@StefanRRichter Please help to review this PR, thanks :)

@wujinhu
Copy link
Contributor Author

wujinhu commented Jan 14, 2019

@StefanRRichter Would you pls review this PR? It has been pending for half a month, thanks.

Copy link
Contributor

@StefanRRichter StefanRRichter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, I think it looks very good. I will partition this into three commits, before merging (1 code fix, 1 doc fix, the test rewrites). 👍


if (scheme.startsWith("s3") || scheme.startsWith("emr")) {
// the Amazon S3 storage
if (scheme.startsWith("s3") || scheme.startsWith("emr") || scheme.startsWith("oss")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this change should go into s separate commit, either with a different jira or as hotfix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I think hotfix will be better.

@wujinhu
Copy link
Contributor Author

wujinhu commented Jan 15, 2019

Thanks @StefanRRichter
I will upload test results if you think it's time now.

@StefanRRichter
Copy link
Contributor

Ok, please upload the result and I will merge after that.

@wujinhu
Copy link
Contributor Author

wujinhu commented Jan 16, 2019

@StefanRRichter
I found an issue when I run mvn clean install with s3 credentials, it fails.
[INFO]
[INFO] force-shading ...................................... SUCCESS [ 1.742 s]
[INFO] flink .............................................. SUCCESS [ 8.802 s]
[INFO] flink-annotations .................................. SUCCESS [ 1.359 s]
[INFO] flink-shaded-hadoop ................................ SUCCESS [ 0.173 s]
[INFO] flink-shaded-hadoop2 ............................... SUCCESS [ 12.045 s]
[INFO] flink-shaded-hadoop2-uber .......................... SUCCESS [ 17.859 s]
[INFO] flink-shaded-yarn-tests ............................ SUCCESS [ 12.220 s]
[INFO] flink-shaded-curator ............................... SUCCESS [ 0.812 s]
[INFO] flink-metrics ...................................... SUCCESS [ 0.108 s]
[INFO] flink-metrics-core ................................. SUCCESS [ 2.664 s]
[INFO] flink-test-utils-parent ............................ SUCCESS [ 0.124 s]
[INFO] flink-test-utils-junit ............................. SUCCESS [ 1.834 s]
[INFO] flink-core ......................................... SUCCESS [01:15 min]
[INFO] flink-java ......................................... SUCCESS [ 29.085 s]
[INFO] flink-queryable-state .............................. SUCCESS [ 0.105 s]
[INFO] flink-queryable-state-client-java .................. SUCCESS [ 2.713 s]
[INFO] flink-filesystems .................................. SUCCESS [ 0.125 s]
[INFO] flink-hadoop-fs .................................... SUCCESS [ 11.096 s]
[INFO] flink-runtime ...................................... SUCCESS [12:00 min]
[INFO] flink-scala ........................................ SUCCESS [01:09 min]
[INFO] flink-mapr-fs ...................................... SUCCESS [ 3.911 s]
[INFO] flink-filesystems :: flink-fs-hadoop-shaded ........ SUCCESS [ 5.436 s]
[INFO] flink-s3-fs-base ................................... SUCCESS [ 10.906 s]
[INFO] flink-s3-fs-hadoop ................................. SUCCESS [04:04 min]
[INFO] flink-s3-fs-presto ................................. FAILURE [ 22.152 s]
[INFO] flink-swift-fs-hadoop .............................. SKIPPED

Error message:
[ERROR] Errors:
[ERROR] PrestoS3FileSystemBehaviorITCase>FileSystemBehaviorTestSuite.cleanup:81 » NoSuchMethod
[ERROR] PrestoS3FileSystemBehaviorITCase>FileSystemBehaviorTestSuite.cleanup:81 » NoSuchMethod
[ERROR] PrestoS3FileSystemBehaviorITCase>FileSystemBehaviorTestSuite.cleanup:81 » NoSuchMethod
[ERROR] org.apache.flink.fs.s3presto.PrestoS3FileSystemBehaviorITCase.testMkdirsFailsForExistingFile(org.apache.flink.fs.s3presto.PrestoS3FileSystemBehaviorITCase)
[ERROR] Run 1: PrestoS3FileSystemBehaviorITCase>FileSystemBehaviorTestSuite.testMkdirsFailsForExistingFile:154->FileSystemBehaviorTestSuite.assumeNotObjectStore:207 » AssumptionViolated
[ERROR] Run 2: PrestoS3FileSystemBehaviorITCase>FileSystemBehaviorTestSuite.cleanup:81 » NoSuchMethod
[INFO]
[ERROR] org.apache.flink.fs.s3presto.PrestoS3FileSystemBehaviorITCase.testMkdirsFailsWithExistingParentFile(org.apache.flink.fs.s3presto.PrestoS3FileSystemBehaviorITCase)
[ERROR] Run 1: PrestoS3FileSystemBehaviorITCase>FileSystemBehaviorTestSuite.testMkdirsFailsWithExistingParentFile:172->FileSystemBehaviorTestSuite.assumeNotObjectStore:207 » AssumptionViolated
[ERROR] Run 2: PrestoS3FileSystemBehaviorITCase>FileSystemBehaviorTestSuite.cleanup:81 » NoSuchMethod
[INFO]
[ERROR] org.apache.flink.fs.s3presto.PrestoS3FileSystemBehaviorITCase.testMkdirsReturnsTrueForExistingDirectory(org.apache.flink.fs.s3presto.PrestoS3FileSystemBehaviorITCase)
[ERROR] Run 1: PrestoS3FileSystemBehaviorITCase>FileSystemBehaviorTestSuite.testMkdirsReturnsTrueForExistingDirectory:145->FileSystemBehaviorTestSuite.createRandomFileInDirectory:203->FileSystemBehaviorTestSuite.createFile:196 » NoSuchMethod
[ERROR] Run 2: PrestoS3FileSystemBehaviorITCase>FileSystemBehaviorTestSuite.cleanup:81 » NoSuchMethod
[INFO]
[ERROR] PrestoS3FileSystemBehaviorITCase>FileSystemBehaviorTestSuite.cleanup:81 » NoSuchMethod
[ERROR] PrestoS3FileSystemBehaviorITCase>FileSystemBehaviorTestSuite.cleanup:81 » NoSuchMethod
[ERROR] PrestoS3FileSystemITCase.testConfigKeysForwarding:103 » NoSuchMethod com.googl...
[ERROR] PrestoS3FileSystemITCase.testConfigKeysForwarding:103 » NoSuchMethod com.googl...
[ERROR] PrestoS3FileSystemITCase.testDirectoryListing:191 » NoSuchMethod com.google.co...
[ERROR] PrestoS3FileSystemITCase.testDirectoryListing:191 » NoSuchMethod com.google.co...
[ERROR] PrestoS3FileSystemITCase.testSimpleFileWriteAndRead:171 » NoSuchMethod com.goo...
[ERROR] PrestoS3FileSystemITCase.testSimpleFileWriteAndRead:171 » NoSuchMethod com.goo...
[INFO]
[ERROR] Tests run: 14, Failures: 0, Errors: 14, Skipped: 0

However, when I enter flink-systems/flink-s3-fs-presto and ran the same command, it's OK.

I found flink master branch also has this issue. Do you think I should fire another issue fix this first, or am I missing sth?

@wujinhu
Copy link
Contributor Author

wujinhu commented Jan 16, 2019

Test results from this PR:

  1. Ran tests except flink-s3-fs-presto moudle
    MyMacBook:flink-filesystems wujinhu$ IT_CASE_S3_BUCKET=...IT_CASE_S3_ACCESS_KEY=.... mvn clean install -pl '!flink-s3-fs-presto'
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    [INFO]
    [INFO] flink-filesystems .................................. SUCCESS [ 3.019 s]
    [INFO] flink-hadoop-fs .................................... SUCCESS [ 10.914 s]
    [INFO] flink-mapr-fs ...................................... SUCCESS [ 3.593 s]
    [INFO] flink-filesystems :: flink-fs-hadoop-shaded ........ SUCCESS [ 6.652 s]
    [INFO] flink-s3-fs-base ................................... SUCCESS [ 10.916 s]
    [INFO] flink-s3-fs-hadoop ................................. SUCCESS [03:58 min]
    [INFO] flink-swift-fs-hadoop .............................. SUCCESS [ 19.842 s]
    [INFO] flink-oss-fs-hadoop ................................ SUCCESS [ 15.325 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 05:09 min
    [INFO] Finished at: 2019-01-16T12:10:22+08:00
    [INFO] Final Memory: 101M/1495M
    [INFO] ------------------------------------------------------------------------
  2. Run tests for flink-s3-fs-presto moudle
    MyMacBook:flink-s3-fs-presto wujinhu$ IT_CASE_S3_BUCKET=...IT_CASE_S3_ACCESS_KEY=.... mvn clean install

[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.flink.fs.s3presto.PrestoS3FileSystemBehaviorITCase
[INFO] Running org.apache.flink.fs.s3presto.PrestoS3FileSystemITCase
[WARNING] Tests run: 8, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 11.915 s - in org.apache.flink.fs.s3presto.PrestoS3FileSystemBehaviorITCase
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 41.194 s - in org.apache.flink.fs.s3presto.PrestoS3FileSystemITCase
[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 14, Failures: 0, Errors: 0, Skipped: 2
[INFO]
[INFO]
.........
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:03 min
[INFO] Finished at: 2019-01-16T12:11:47+08:00
[INFO] Final Memory: 66M/1512M
[INFO] ------------------------------------------------------------------------

@StefanRRichter
Copy link
Contributor

LGTM 👍 Merging.

@asfgit asfgit closed this in c08db3f Jan 16, 2019
@wujinhu
Copy link
Contributor Author

wujinhu commented Jan 16, 2019

@StefanRRichter Thanks, but what about the issue I mentioned? Flink master branch tests fail if I execute command in flink-s3-fs-presto's parent directory.

@StefanRRichter
Copy link
Contributor

But you said this was the same in the master, so it is would not be a regression from this PR and can be fixed independently.

@wujinhu
Copy link
Contributor Author

wujinhu commented Jan 16, 2019

But you said this was the same in the master, so it is would not be a regression from this PR and can be fixed independently.
@StefanRRichter
OK, I think I can fire another jira to fix this.

@StefanRRichter
Copy link
Contributor

Thanks!

tisonkun pushed a commit to tisonkun/flink that referenced this pull request Jan 17, 2019
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