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

Reviewed-by: Takanobu Asanuma <tasanuma@apache.org>
This commit is contained in:
Akira Ajisaka 2021-06-10 14:29:47 +09:00 committed by GitHub
parent b3c7254563
commit 9a17f97133
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 23 deletions

View File

@ -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);
@ -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",
@ -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);
@ -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);
@ -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",
@ -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);

View File

@ -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
@ -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",
@ -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);
@ -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 " +
@ -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);
@ -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",
@ -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);
@ -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 " +