Skip to content
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

THRIFT-5560: use junit 5 for all java unit tests #2574

Merged
merged 2 commits into from May 5, 2022

Conversation

Jimexist
Copy link
Member

@Jimexist Jimexist commented Apr 17, 2022

use junit 5 for all java unit tests

  • Did you create an Apache Jira ticket? (not required for trivial changes)
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

@Jimexist Jimexist force-pushed the java-junit-5 branch 5 times, most recently from 0210f82 to 520c43f Compare April 17, 2022 06:49
@Jimexist Jimexist changed the title use junit 5 for all java unit tests THRIFT-5560: use junit 5 for all java unit tests Apr 17, 2022
@Jimexist Jimexist force-pushed the java-junit-5 branch 2 times, most recently from 722487c to ce7dcae Compare April 17, 2022 07:07
Copy link
Member

@ctubbsii ctubbsii left a comment

Choose a reason for hiding this comment

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

Overall, these changes look really good, and will be a nice improvement. I had a few suggestions. Also, please don't force push. This PR is pretty big, and it would be easier to see the incremental changes if you don't force push. All the commits can be squashed and/or force-pushed after the bulk of the reviews are done.

lib/java/gradle/environment.gradle Outdated Show resolved Hide resolved
lib/java/test/org/apache/thrift/TestFullCamel.java Outdated Show resolved Hide resolved
lib/java/test/org/apache/thrift/TestFullCamel.java Outdated Show resolved Hide resolved
lib/java/test/org/apache/thrift/TestReuse.java Outdated Show resolved Hide resolved
lib/java/test/org/apache/thrift/TestStruct.java Outdated Show resolved Hide resolved
lib/java/test/org/apache/thrift/test/EqualityTest.java Outdated Show resolved Hide resolved
Copy link
Member

@ctubbsii ctubbsii left a comment

Choose a reason for hiding this comment

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

Looks good overall. However, need to make sure all the tests pass after this change before merging.

@Jimexist
Copy link
Member Author

honestly i have no idea why just switching to JUnit 5 results in this error:

TestTSSLTransportFactoryCustomClient2 > testIt() FAILED
    org.apache.thrift.transport.TTransportException at TestTSSLTransportFactoryCustomClient2.java:32
        Caused by: java.io.IOException at TestTSSLTransportFactoryCustomClient2.java:32

but there's no stacktrace and I can't reproduce it locally.

@Jimexist
Copy link
Member Author

turns out it was a race condition: some unit tests were modifying system property while others read from it. this was not an issue before because forkEvery=1 is enabled for gradle which fully isolate these side effects but the correct way is to get rid of such side effects in unit tests and then fully parallelize the unit test.

@Jimexist
Copy link
Member Author

had to rebase to pickup fix from #2585

@Jimexist
Copy link
Member Author

test failures seem flaky - the C++ ones are failing...

@Jimexist
Copy link
Member Author

Jimexist commented May 5, 2022

hi @ctubbsii do you still have any questions regarding this pull request? if no possibly this can be merged before:

because otherwise it'll introduce a lot of hard to resolve conflicts with this; on the other hand i can always just re-format if this pull request goes in first

@ctubbsii ctubbsii merged commit 0c9c9df into apache:master May 5, 2022
@ctubbsii
Copy link
Member

ctubbsii commented May 5, 2022

hi @ctubbsii do you still have any questions regarding this pull request? if no possibly this can be merged before:

because otherwise it'll introduce a lot of hard to resolve conflicts with this; on the other hand i can always just re-format if this pull request goes in first

@Jimexist I merged this first, because I thought you were saying this PR should be merged before that one. But, now I see conflicts in that one. So, I'm wondering if you meant that one could be merged first. Apologies if I misunderstood. I can merge that one in next once the conflicts are resolved.

On this PR, I understood: this = 2574; that = 2581.

@Jimexist Jimexist deleted the java-junit-5 branch May 6, 2022 00:13
ctubbsii added a commit that referenced this pull request May 6, 2022
Convert TestAnnotationMetadata to JUnit5 API. This class was not
included in THRIFT-5560 (PR #2574) when the conversion was done because
this was a new class added in THRIFT-5544 (PR #2553), which was merged
first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants