Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you see a chance that test could fail due to a quite low socket timeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well... it is a good question that made me wonder in case of a successful connection how long the KerberosAuthenticator#190 connect is running, and the plot-twist i just realized all of the tests expect timeout here 😅
If you add a some debug point before and after this line we can observe the debug point after the connect will never be triggered, so technically we can also write 1ms here, the tests can not be broken

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, in that case LGTM.

}

@AfterEach
Expand All @@ -88,6 +89,7 @@ public void tearDown() throws Exception {
if (isSSLConfigured()) {
KeyStoreTestUtil.cleanupSSLConfig(keystoresDir, sslConfDir);
}
TimelineConnector.DEFAULT_SOCKET_TIMEOUT = 60_000;
}

@Test
Expand Down