slfan1989 commented on code in PR #7350:
URL: https://github.com/apache/hadoop/pull/7350#discussion_r1943692108


##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/WebApps.java:
##########
@@ -369,9 +369,15 @@ public void setup() {
 
         if (httpScheme.equals(WebAppUtils.HTTPS_PREFIX)) {
           String amKeystoreLoc = System.getenv("KEYSTORE_FILE_LOCATION");
+          if (StringUtils.isBlank(amKeystoreLoc)) {

Review Comment:
   Thank you for your question! 
   
   We made this adjustment because the unit tests 
`TestAMWebApp#testMRWebAppSSLEnabled` and 
`TestAMWebApp#testMRWebAppSSLEnabledWithClientAuth` are failing in JUnit 5.
   
   In the original JUnit 4 environment, these tests relied on the 
`EnvironmentVariables.set` method to modify `System.Env` data. However, in 
JUnit 5, we can no longer modify the environment variables directly. One 
important reason for this is that starting from JDK 9, `System.Env` became an 
immutable structure. It is recommended to use `System.setProperty` and 
`System.getProperty` as replacements.
   
   Therefore, we modified the unit tests to temporarily set 
`System.setProperty`, and also check if the variables we set exist in 
`System.getProperty` when used.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to