-
Notifications
You must be signed in to change notification settings - Fork 426
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
RATIS-2251. Migrate ratis-test tests to Junit 5 - Part 3. #1227
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slfan1989 , thanks a lot for working on this! The change looks good in general. Let's also clean up TestReConfigProperty
; see https://issues.apache.org/jira/secure/attachment/13074931/1227_review.patch
BTW, there are test failures. Please take a look.
Assertions.assertFalse( | ||
exceptionCaught, "received unexpected exception"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use fail(..)
inside the catch-block instead of assertFalse(..)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@szetszwo Thank you very much for reviewing this PR and providing suggestions! I will continue to improve this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need some time to validate the unit tests for the issue and will provide a response as soon as possible.
Not sure why it has IllegalStateException in https://github.com/apache/ratis/actions/runs/13490213066/job/37726235717?pr=1227#step:11:886
|
@szetszwo Thank you for your message. I am currently conducting local tests to identify the cause of the issue. |
@slfan1989 , Thanks for the update! The subclass tests related to |
@szetszwo Thank you very much for your message! I will attempt to roll back these two classes and continue testing locally. I have upgraded the JUnit dependency and the version of the surefire-plugin. The previous java.lang.IllegalStateException error is no longer occurring, and I will continue testing today. |
I have carefully reviewed the CI report, and these errors are likely unrelated to the JUnit 5 upgrade. The same errors existed in JUnit 4 as well and can still be reproduced locally. Let me summarize the current situation regarding the unit test errors.
Junit4 Success.
|
@slfan1989 , after RATIS-2124 is merged, we need to resolve the conflicts here. Thanks. |
@szetszwo Thank you for your message! I will continue to follow up on this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slfan1989 , thanks a lot for you hard work! Not sure why the unit tests keep failing here but not the other PRs such as #1228 . Let's try updating surefire to see if it make a difference.
@@ -174,7 +174,7 @@ | |||
<maven-pdf-plugin.version>1.6.1</maven-pdf-plugin.version> | |||
<maven-remote-resources-plugin.version>3.3.0</maven-remote-resources-plugin.version> | |||
<maven-shade-plugin.version>3.6.0</maven-shade-plugin.version> | |||
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version> | |||
<maven-surefire-plugin.version>3.0.0-M9</maven-surefire-plugin.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about try updating it to the latest 3.5.2?
https://maven.apache.org/surefire/maven-surefire-plugin/usage.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried updating surefire to 3.5.2 (RATIS-2257), but had some problems:
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.2:test (default-test) on project ratis-docs: groups/excludedGroups require TestNG, JUnit48+ or JUnit 5 (a specific engine required on classpath) on project test classpath
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.2:test (default-test) on project ratis-proto: groups/excludedGroups require TestNG, JUnit48+ or JUnit 5 (a specific engine required on classpath) on project test classpath
These modules have skipTests=true
, so I don't understand why surefire wants to run tests. Also tried with maven.test.skip=true
, which should even skip test compilation, but the problem still happened.
It would be great if you can make it work.
adoroszlai@d53a586
https://github.com/adoroszlai/ratis/actions/runs/13670191390
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adoroszlai , thanks for checking! It succeeded when running it locally but it failed in GitHub https://github.com/szetszwo/ratis/actions/runs/13725256050
It may be a problem in our githut action configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error says it's related to using excludedGroups
:
groups/excludedGroups require TestNG, JUnit48+ or JUnit 5 (a specific engine required on classpath) on project test classpath
which is set in CI:
Line 1122 in d740e51
<excludedGroups>${flaky-test-groups}</excludedGroups> |
This should not happen with skipTests
, which we set for ratis-docs
here:
Lines 31 to 32 in d740e51
<!-- no testable code in this module --> | |
<skipTests>true</skipTests> |
What changes were proposed in this pull request?
Trying to upgrade ratis-server's Junit4 unit tests to Junit5.
What is the link to the Apache JIRA
JIRA: RATIS-2251. Migrate ratis-test tests to Junit 5 - Part 3.
How was this patch tested?
Junit Test & mvn clean test.