diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineConnector.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineConnector.java index 5a216d20d3..b139bddd10 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineConnector.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/TimelineConnector.java @@ -78,7 +78,8 @@ public class TimelineConnector extends AbstractService { private static final Joiner JOINER = Joiner.on(""); private static final Logger LOG = LoggerFactory.getLogger(TimelineConnector.class); - public final static int DEFAULT_SOCKET_TIMEOUT = 1 * 60 * 1000; // 1 minute + @VisibleForTesting + public static int DEFAULT_SOCKET_TIMEOUT = 60_000; // 1 minute private SSLFactory sslFactory; Client client; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java index 4b9b7c5f50..cac620f669 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/client/api/impl/TestTimelineClient.java @@ -78,6 +78,7 @@ public void setup() { conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true); conf.setFloat(YarnConfiguration.TIMELINE_SERVICE_VERSION, 1.0f); client = createTimelineClient(conf); + TimelineConnector.DEFAULT_SOCKET_TIMEOUT = 10; } @AfterEach @@ -88,6 +89,7 @@ public void tearDown() throws Exception { if (isSSLConfigured()) { KeyStoreTestUtil.cleanupSSLConfig(keystoresDir, sslConfDir); } + TimelineConnector.DEFAULT_SOCKET_TIMEOUT = 60_000; } @Test