-
Notifications
You must be signed in to change notification settings - Fork 9k
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
YARN-11796. Accept extra JDK 17 options in tests #7512
Conversation
🎊 +1 overall
This message was automatically generated. |
@pan3793 Could you review this PR? Thank you very much! I remember you made similar changes, but I'm not sure if the changes in this PR are necessary. |
|
||
if (Shell.isJavaVersionAtLeast(17)) { | ||
assertTrue(result.remove("--add-exports=java.base/sun.net.dns=ALL-UNNAMED")); | ||
assertTrue(result.remove("--add-exports=java.base/sun.net.util=ALL-UNNAMED")); |
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.
MAPREDUCE-7456 defines
private static final String ADDITIONAL_JDK17_PLUS_OPTIONS =
"--add-opens=java.base/java.lang=ALL-UNNAMED " +
"--add-exports=java.base/sun.net.dns=ALL-UNNAMED " +
"--add-exports=java.base/sun.net.util=ALL-UNNAMED";
Why should only the last two be removed?
BTW, could you please leave a few comments that at least mention MAPREDUCE-7456 ?
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.
Thank you @pan3793 .
JDK17 options are defined at several locations.
Other than the one you mentioned, they are also defined in org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ContainerLocalizer which only adds
these two, and apparently these tests trigger that one.
If I added all three, the tests would fail, as --add-opens=java.base/java.lang=ALL-UNNAMED is never added for those test cases.
This also bothers me, I have opened HADOOP-19505 earlier to track this. (Though I have no immediate plans to work on that)
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.
As for comments, most tests in TestContainerLocalizer already have similar ifs for JDK17 (I guess these were just added later, and never tested with JDK17).
Would you like me to add comments to those as well ?
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.
Would you like me to add comments to those as well ?
Yes, please do that, I think the brief comments should help future explorers easy to understand the test code for this case
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.
Done.
🎊 +1 overall
This message was automatically generated. |
@slfan1989 Could you take another look, and commit if you are satisfied ? |
@stoty Thanks for the contribution! LGTM. |
Description of PR
JIRA: YARN-11796. Accept extra JDK 17 options in tests
Accept options automatically added when run on JDK17+ in relevant tests
How was this patch tested?
Ran the modified tests with JDK8 and JDK17
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?