Skip to content

HDDS-10056. Silent failure in unit check#5913

Merged
adoroszlai merged 2 commits intoapache:masterfrom
adoroszlai:HDDS-10056
Jan 3, 2024
Merged

HDDS-10056. Silent failure in unit check#5913
adoroszlai merged 2 commits intoapache:masterfrom
adoroszlai:HDDS-10056

Conversation

@adoroszlai
Copy link
Contributor

@adoroszlai adoroszlai commented Jan 3, 2024

What changes were proposed in this pull request?

HDDS-10013 removed dependency on junit from modules which do not have tests. Now unit check finishes with success in 1 minute instead of running unit tests:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.2:test (default-test) on project hdds-annotation-processing: groups/excludedGroups require TestNG, JUnit48+ or JUnit 5 (a specific engine required on classpath) on project test classpath -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.2:test (default-test) on project hdds-hadoop-dependency-client: groups/excludedGroups require TestNG, JUnit48+ or JUnit 5 (a specific engine required on classpath) on project test classpath -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.2:test (default-test) on project hdds-hadoop-dependency-server: groups/excludedGroups require TestNG, JUnit48+ or JUnit 5 (a specific engine required on classpath) on project test classpath -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.2:test (default-test) on project hdds-interface-client: groups/excludedGroups require TestNG, JUnit48+ or JUnit 5 (a specific engine required on classpath) on project test classpath -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.2:test (default-test) on project hdds-docs: groups/excludedGroups require TestNG, JUnit48+ or JUnit 5 (a specific engine required on classpath) on project test classpath -> [Help 1]

This change adds maven.test.skip=true in such modules to prevent the problem.

It also tweaks junit.sh (run by unit check) to look for errors other than test failures in Maven output to avoid silent failure of the check.

https://issues.apache.org/jira/browse/HDDS-10056

How was this patch tested?

Ran unit check locally (restricted to a single test for quick results):

$ hadoop-ozone/dev-support/checks/unit.sh -Dtest='TestOzoneManagerDoubleBufferWithOMResponse'

Also verified that the fix in junit.sh without the POM changes catches the failure:

$ hadoop-ozone/dev-support/checks/unit.sh -Dtest='TestOzoneManagerDoubleBufferWithOMResponse' > /dev/null 2>&1
$ echo $?
1
$ bash hadoop-ozone/dev-support/checks/_summary.sh target/unit/summary.txt
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.2:test (default-test) on project hdds-annotation-processing: groups/excludedGroups require TestNG, JUnit48+ or JUnit 5 (a specific engine required on classpath) on project test classpath -> [Help 1]
$ echo $?
1

CI:
https://github.com/adoroszlai/ozone/actions/runs/7395145245/job/20117969381

@adoroszlai adoroszlai added the CI label Jan 3, 2024
@adoroszlai adoroszlai self-assigned this Jan 3, 2024
@adoroszlai adoroszlai requested a review from sadanand48 January 3, 2024 09:02
Copy link
Contributor

@sadanand48 sadanand48 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 the patch @adoroszlai , LGTM.

@adoroszlai adoroszlai merged commit 9f47580 into apache:master Jan 3, 2024
@adoroszlai adoroszlai deleted the HDDS-10056 branch January 3, 2024 12:04
@adoroszlai
Copy link
Contributor Author

Thanks a lot @sadanand48 for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants