Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YARN-10803. [JDK 11] TestRMFailoverProxyProvider and TestNoHaRMFailoverProxyProvider fails by ClassCastException #3068

Merged
merged 1 commit into from Jun 10, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -140,9 +140,9 @@ public void testDefaultFPPGetOneProxy() throws Exception {
// Create a proxy and mock a RMProxy
Proxy mockProxy1 = new TestProxy((proxy, method, args) -> null);
Class protocol = ApplicationClientProtocol.class;
RMProxy mockRMProxy = mock(RMProxy.class);
DefaultNoHARMFailoverProxyProvider <RMProxy> fpp =
new DefaultNoHARMFailoverProxyProvider<RMProxy>();
RMProxy<Proxy> mockRMProxy = mock(RMProxy.class);
DefaultNoHARMFailoverProxyProvider<Proxy> fpp =
new DefaultNoHARMFailoverProxyProvider<>();

InetSocketAddress mockAdd1 = new InetSocketAddress(RM1_PORT);

Expand All @@ -154,7 +154,7 @@ public void testDefaultFPPGetOneProxy() throws Exception {

// Initialize failover proxy provider and get proxy from it.
fpp.init(conf, mockRMProxy, protocol);
FailoverProxyProvider.ProxyInfo<RMProxy> actualProxy1 = fpp.getProxy();
FailoverProxyProvider.ProxyInfo<Proxy> actualProxy1 = fpp.getProxy();
assertEquals(
"AutoRefreshRMFailoverProxyProvider doesn't generate " +
"expected proxy",
Expand All @@ -180,7 +180,7 @@ public void testDefaultFPPGetOneProxy() throws Exception {

// Perform Failover and get proxy again from failover proxy provider
fpp.performFailover(actualProxy1.proxy);
FailoverProxyProvider.ProxyInfo<RMProxy> actualProxy2 = fpp.getProxy();
FailoverProxyProvider.ProxyInfo<Proxy> actualProxy2 = fpp.getProxy();
assertEquals("AutoRefreshRMFailoverProxyProvider " +
"doesn't generate expected proxy after failover",
mockProxy1, actualProxy2.proxy);
Expand Down Expand Up @@ -208,9 +208,9 @@ public void testAutoRefreshIPChange() throws Exception {
Proxy mockProxy1 = new TestProxy((proxy, method, args) -> null);
Proxy mockProxy2 = new TestProxy((proxy, method, args) -> null);
Class protocol = ApplicationClientProtocol.class;
RMProxy mockRMProxy = mock(RMProxy.class);
AutoRefreshNoHARMFailoverProxyProvider<RMProxy> fpp =
new AutoRefreshNoHARMFailoverProxyProvider<RMProxy>();
RMProxy<Proxy> mockRMProxy = mock(RMProxy.class);
AutoRefreshNoHARMFailoverProxyProvider<Proxy> fpp =
new AutoRefreshNoHARMFailoverProxyProvider<>();

// generate two address with different ports.
InetSocketAddress mockAdd1 = new InetSocketAddress(RM1_PORT);
Expand All @@ -224,7 +224,7 @@ public void testAutoRefreshIPChange() throws Exception {

// Initialize proxy provider and get proxy from it.
fpp.init(conf, mockRMProxy, protocol);
FailoverProxyProvider.ProxyInfo <RMProxy> actualProxy1 = fpp.getProxy();
FailoverProxyProvider.ProxyInfo<Proxy> actualProxy1 = fpp.getProxy();
assertEquals(
"AutoRefreshRMFailoverProxyProvider doesn't generate " +
"expected proxy",
Expand Down Expand Up @@ -259,7 +259,7 @@ public void testAutoRefreshIPChange() throws Exception {

// Perform Failover and get proxy again from failover proxy provider
fpp.performFailover(actualProxy1.proxy);
FailoverProxyProvider.ProxyInfo <RMProxy> actualProxy2 = fpp.getProxy();
FailoverProxyProvider.ProxyInfo<Proxy> actualProxy2 = fpp.getProxy();
assertEquals("AutoRefreshNoHARMFailoverProxyProvider " +
"doesn't generate expected proxy after failover",
mockProxy2, actualProxy2.proxy);
Expand Down
Expand Up @@ -87,9 +87,9 @@ public void testFailoverChange() throws Exception {
Proxy mockProxy1 = new TestProxy((proxy, method, args) -> null);

Class protocol = ApplicationClientProtocol.class;
RMProxy mockRMProxy = mock(RMProxy.class);
ConfiguredRMFailoverProxyProvider<RMProxy> fpp =
new ConfiguredRMFailoverProxyProvider<RMProxy>();
RMProxy<Proxy> mockRMProxy = mock(RMProxy.class);
ConfiguredRMFailoverProxyProvider<Proxy> fpp =
new ConfiguredRMFailoverProxyProvider<>();

// generate two address with different ports.
// Default port of yarn RM
Expand All @@ -104,7 +104,7 @@ public void testFailoverChange() throws Exception {

// Initialize failover proxy provider and get proxy from it.
fpp.init(conf, mockRMProxy, protocol);
FailoverProxyProvider.ProxyInfo<RMProxy> actualProxy1 = fpp.getProxy();
FailoverProxyProvider.ProxyInfo<Proxy> actualProxy1 = fpp.getProxy();
assertEquals(
"ConfiguredRMFailoverProxyProvider doesn't generate " +
"expected proxy",
Expand Down Expand Up @@ -139,7 +139,7 @@ public void testFailoverChange() throws Exception {

// Perform Failover and get proxy again from failover proxy provider
fpp.performFailover(actualProxy1.proxy);
FailoverProxyProvider.ProxyInfo <RMProxy> actualProxy2 = fpp.getProxy();
FailoverProxyProvider.ProxyInfo<Proxy> actualProxy2 = fpp.getProxy();
assertEquals("ConfiguredRMFailoverProxyProvider " +
"doesn't generate expected proxy after failover",
mockProxy2, actualProxy2.proxy);
Expand Down Expand Up @@ -167,7 +167,7 @@ public void testFailoverChange() throws Exception {

// Perform Failover and get proxy again from failover proxy provider
fpp.performFailover(actualProxy2.proxy);
FailoverProxyProvider.ProxyInfo <RMProxy> actualProxy3 = fpp.getProxy();
FailoverProxyProvider.ProxyInfo<Proxy> actualProxy3 = fpp.getProxy();

// check the proxy is the same as the one we created before.
assertEquals("ConfiguredRMFailoverProxyProvider " +
Expand Down Expand Up @@ -202,11 +202,10 @@ public void testAutoRefreshFailoverChange() throws Exception {
// Create three proxies and mock a RMProxy
Proxy mockProxy1 = new TestProxy((proxy, method, args) -> null);
Proxy mockProxy2 = new TestProxy((proxy, method, args) -> null);
Proxy mockProxy3 = new TestProxy((proxy, method, args) -> null);
Class protocol = ApplicationClientProtocol.class;
RMProxy mockRMProxy = mock(RMProxy.class);
AutoRefreshRMFailoverProxyProvider<RMProxy> fpp =
new AutoRefreshRMFailoverProxyProvider<RMProxy>();
RMProxy<Proxy> mockRMProxy = mock(RMProxy.class);
AutoRefreshRMFailoverProxyProvider<Proxy> fpp =
new AutoRefreshRMFailoverProxyProvider<>();

// generate three address with different ports.
InetSocketAddress mockAdd1 = new InetSocketAddress(RM1_PORT);
Expand All @@ -222,7 +221,7 @@ public void testAutoRefreshFailoverChange() throws Exception {

// Initialize failover proxy provider and get proxy from it.
fpp.init(conf, mockRMProxy, protocol);
FailoverProxyProvider.ProxyInfo <RMProxy> actualProxy1 = fpp.getProxy();
FailoverProxyProvider.ProxyInfo<Proxy> actualProxy1 = fpp.getProxy();
assertEquals(
"AutoRefreshRMFailoverProxyProvider doesn't generate " +
"expected proxy",
Expand Down Expand Up @@ -257,7 +256,7 @@ public void testAutoRefreshFailoverChange() throws Exception {

// Perform Failover and get proxy again from failover proxy provider
fpp.performFailover(actualProxy1.proxy);
FailoverProxyProvider.ProxyInfo <RMProxy> actualProxy2 = fpp.getProxy();
FailoverProxyProvider.ProxyInfo<Proxy> actualProxy2 = fpp.getProxy();
assertEquals("AutoRefreshRMFailoverProxyProvider " +
"doesn't generate expected proxy after failover",
mockProxy2, actualProxy2.proxy);
Expand Down Expand Up @@ -285,7 +284,7 @@ public void testAutoRefreshFailoverChange() throws Exception {

// Perform Failover and get proxy again from failover proxy provider
fpp.performFailover(actualProxy2.proxy);
FailoverProxyProvider.ProxyInfo <RMProxy> actualProxy3 = fpp.getProxy();
FailoverProxyProvider.ProxyInfo<Proxy> actualProxy3 = fpp.getProxy();

// check the proxy is the same as the one we created before.
assertEquals("ConfiguredRMFailoverProxyProvider " +
Expand Down