From 3d21cff263c68a45b45b927e3ddb411e925d8eb6 Mon Sep 17 00:00:00 2001 From: slfan1989 <55643692+slfan1989@users.noreply.github.com> Date: Thu, 12 Jan 2023 21:29:05 +0800 Subject: [PATCH] YARN-11413. Fix Junit Test ERROR Introduced By YARN-6412. (#5289) * YARN-11413. Fix Junit Test ERROR Introduced By YARN-6412. * YARN-11413. Fix CheckStyle. * YARN-11413. Fix CheckStyle. Co-authored-by: slfan1989 --- .../hadoop/conf/TestConfigurationFieldsBase.java | 2 +- .../yarn/conf/TestYarnConfigurationFields.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfigurationFieldsBase.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfigurationFieldsBase.java index 152159b3f3..879f1781d7 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfigurationFieldsBase.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfigurationFieldsBase.java @@ -194,7 +194,7 @@ public abstract class TestConfigurationFieldsBase { HashMap retVal = new HashMap<>(); // Setup regexp for valid properties - String propRegex = "^[A-Za-z][A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)+$"; + String propRegex = "^[A-Za-z][A-Za-z0-9_-]+(\\.[A-Za-z%s0-9_-]+)+$"; Pattern p = Pattern.compile(propRegex); // Iterate through class member variables diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfigurationFields.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfigurationFields.java index 84e4b561e5..f7747c6216 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfigurationFields.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/test/java/org/apache/hadoop/yarn/conf/TestYarnConfigurationFields.java @@ -223,6 +223,20 @@ public void initializeMemberVariables() { "yarn.log-aggregation.file-controller.TFile.class"); // Add the filters used for checking for collision of default values. initDefaultValueCollisionCheck(); + + configurationPropsToSkipCompare.add(YarnConfiguration.LOG_AGGREGATION_REMOTE_APP_LOG_DIR_FMT); + configurationPropsToSkipCompare.add( + YarnConfiguration.LOG_AGGREGATION_REMOTE_APP_LOG_DIR_SUFFIX_FMT); + configurationPropsToSkipCompare.add(YarnConfiguration.LOG_AGGREGATION_FILE_CONTROLLER_FMT); + configurationPropsToSkipCompare.add(YarnConfiguration.NM_AUX_SERVICE_FMT); + configurationPropsToSkipCompare.add( + YarnConfiguration.NM_HEALTH_CHECK_SCRIPT_TIMEOUT_MS_TEMPLATE); + configurationPropsToSkipCompare.add(YarnConfiguration.NM_HEALTH_CHECK_SCRIPT_OPTS_TEMPLATE); + configurationPropsToSkipCompare.add(YarnConfiguration.NM_HEALTH_CHECK_SCRIPT_PATH_TEMPLATE); + configurationPropsToSkipCompare.add( + YarnConfiguration.NM_HEALTH_CHECK_SCRIPT_INTERVAL_MS_TEMPLATE); + configurationPropsToSkipCompare.add(YarnConfiguration.NM_AUX_SERVICE_REMOTE_CLASSPATH); + configurationPropsToSkipCompare.add(YarnConfiguration.LINUX_CONTAINER_RUNTIME_CLASS_FMT); } /**