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).
This commit is contained in:
K0K0V0K 2023-12-20 12:10:07 +01:00 committed by GitHub
parent 01bde4afff
commit 5dd1977800
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -78,7 +78,8 @@ public class TimelineConnector extends AbstractService {
private static final Joiner JOINER = Joiner.on(""); private static final Joiner JOINER = Joiner.on("");
private static final Logger LOG = private static final Logger LOG =
LoggerFactory.getLogger(TimelineConnector.class); 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; private SSLFactory sslFactory;
Client client; Client client;

View File

@ -78,6 +78,7 @@ public void setup() {
conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true); conf.setBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED, true);
conf.setFloat(YarnConfiguration.TIMELINE_SERVICE_VERSION, 1.0f); conf.setFloat(YarnConfiguration.TIMELINE_SERVICE_VERSION, 1.0f);
client = createTimelineClient(conf); client = createTimelineClient(conf);
TimelineConnector.DEFAULT_SOCKET_TIMEOUT = 10;
} }
@AfterEach @AfterEach
@ -88,6 +89,7 @@ public void tearDown() throws Exception {
if (isSSLConfigured()) { if (isSSLConfigured()) {
KeyStoreTestUtil.cleanupSSLConfig(keystoresDir, sslConfDir); KeyStoreTestUtil.cleanupSSLConfig(keystoresDir, sslConfDir);
} }
TimelineConnector.DEFAULT_SOCKET_TIMEOUT = 60_000;
} }
@Test @Test