From 5dd1977800f6110d2ef1d037f93c49318f2fbc92 Mon Sep 17 00:00:00 2001 From: K0K0V0K <109747532+K0K0V0K@users.noreply.github.com> Date: Wed, 20 Dec 2023 12:10:07 +0100 Subject: [PATCH] YARN-11634. Speed-up TestTimelineClient (#6371) The TimelineConnector.class has a hardcoded 1 minute connection time out, what makes the TestTimelineClient to a long running test (~15:30 min). Decrease the timeout to 10ms will speed up the test run (~56 sec). --- .../apache/hadoop/yarn/client/api/impl/TimelineConnector.java | 3 ++- .../apache/hadoop/yarn/client/api/impl/TestTimelineClient.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) 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